Skip to main content
added 399 characters in body; deleted 2 characters in body
Source Link
theheadofabroom
  • 21.6k
  • 5
  • 34
  • 65

If you have not committed:

git stash
git checkout some-branch
git stash pop

? If you have committed and have not changed anything since:

git log --oneline -n1 # this will give you the SHA
git checkout some-branch
git merge ${commit-sha}

If you have committed and then done extra work:

git stash
git log --oneline -n1 # this will give you the SHA
git checkout some-branch
git merge ${commit-sha}
git stash pop
git stash
git checkout some-branch
git stash pop

?

If you have not committed:

git stash
git checkout some-branch
git stash pop

If you have committed and have not changed anything since:

git log --oneline -n1 # this will give you the SHA
git checkout some-branch
git merge ${commit-sha}

If you have committed and then done extra work:

git stash
git log --oneline -n1 # this will give you the SHA
git checkout some-branch
git merge ${commit-sha}
git stash pop
Source Link
araqnid
  • 131.2k
  • 25
  • 161
  • 137

git stash
git checkout some-branch
git stash pop

?