Last active
September 15, 2016 17:03
-
-
Save egustafson/76393ef3df716c5bb75f4661d15fd05d to your computer and use it in GitHub Desktop.
git stash on a true branch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1. Store the "stash" on a branch | |
git checkout -b my-stashing-branch ## checkout, creating the branch | |
git add <the files to 'stash'> | |
git commit -m "comment" ## you now have the files on a branch | |
git push -u origin my-stashing-branch ## and saved in your central repo (GitHub) | |
# 2. Use your "stash" branch somewhere else. | |
git checkout somewhere-else | |
git merge my-stashing-branch --no-commit --no-ff ## origin/my-stashing-branch if new clone. | |
git reset |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment