recovering from git's (no branch)


/ Published in: Bash
Save to your folder(s)



Copy this code and paste it in your HTML
  1. # if you have already checked out to master, you won't know the commit-ish of your "no branch":
  2. git fsck --lost-found # (to find your <commit-ish>)
  3. git merge <commit-ish>
  4.  
  5. # if you are still on your "no branch" commit:
  6. git log # (the commit-ish will be on the first line)
  7. git checkout master
  8. git merge <commit-ish>
  9.  
  10. # or
  11. git log | head -n 1 | cut -d ' ' -f 2 | pbcopy
  12. git checkout master
  13. git merge <commit-ish>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.