To mark a file such that you always get its latest versip when you do
git pull, but your changes are never comitted or pushed or shown in the diff:
git update-index --assume-unchanged /path/to/file
And to undo the last step:
git update-index --no-assume-unchaged /path/to/file
When you've made a commit in the detached head state
git checkout -b temp-branch-name
git merge
git branch -d temp-branch-name
git push origin master
Stashing
git stash save "Working on so and so. | 70% complete."
git stash list
git pull
git stash apply
Then resolve any conflicts in the reported files, and do
git add
to mark they're resolved.
git stash apply applies the last stash by default; if you want to apply any earlier stash do:
got stash apply stash@{3}
Stashes are ordered such that
stash@{0} is the latest,
stash@{1} is the one before that ans so on. You can delete the stashes with:
git stash drop stash@{0}
To revert to an older commit.
Coming soon!
No comments:
Post a Comment