Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
software:git [2014/12/19 14:30]
cyril
software:git [2016/01/28 22:02] (current)
cyril [Editing commits]
Line 186: Line 186:
 </code> </code>
  
 +Change author or date: use ''rebase -i'', chose "edit", and commit with:
 +<code>
 +git commit --amend --author "Name <email-address>" --date "$(date -R)"
 +</code>
  
 +To split a commit: use ''rebase -i'', chose "edit", and reset the index to the commit before, and commit: 
 +<code> 
 +git reset --mixed @~ 
 +git add -p . 
 +git commit 
 +</code>
 ==== Archive generation ==== ==== Archive generation ====
  
Line 216: Line 225:
  
 [[http://www.dmo.ca/blog/20080307124544/]] [[http://www.dmo.ca/blog/20080307124544/]]
 +
 +==== Recovery ====
 +
 +For finding a lost commit you can use "git reflog".
 +
 +For finding a lost stash (eg "git stash drop") or file (eg "git rm"), you can try "git fsck --full", and then use "git show" with the hash to see the content of the objects.
 +
 +[[https://github.com/blog/2019-how-to-undo-almost-anything-with-git]]
software/git.1418999456.txt.gz · Last modified: 2014/12/19 14:30 by cyril
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0