Return to Snippet

Revision: 23962
at February 17, 2010 15:02 by kmorey


Updated Code
# if you have already checked out to master, you won't know the commit-ish of your "no branch":
  git fsck --lost-found # (to find your <commit-ish>)
  git merge <commit-ish>

# if you are still on your "no branch" commit:
  git log # (the commit-ish will be on the first line)
  git checkout master
  git merge <commit-ish>

# or 
  git log | head -n 1 | cut -d ' ' -f 2 | pbcopy
  git checkout master
  git merge <commit-ish>

Revision: 23961
at February 17, 2010 15:02 by kmorey


Initial Code
if you have already checked out to master, you won't know the commit-ish of your "no branch":
  git fsck --lost-found # (to find your <commit-ish>)
  git merge <commit-ish>

if you are still on your "no branch" commit:
  git log # (the commit-ish will be on the first line)
or 
  git log | head -n 1 | cut -d ' ' -f 2 | pbcopy

  git checkout master
  git merge <commit-ish>

Initial URL


Initial Description


Initial Title
recovering from git's (no branch)

Initial Tags
git

Initial Language
Bash