Updating with local changes
suggest changeWhen local changes are present, the git pull command aborts reporting :
error: Your local changes to the following files would be overwritten by merge
To update anyway, stash the local changes, rebase onto what you fetch, then restore the stash:
git stash
git pull --rebase
git stash pop
A convenient way could be to define an alias using :
git config --global alias.up '!git stash && git pull --rebase && git stash pop'
The next alias replaces the previous one. pull.rebase with --autostash stashes and restores for you (Git 2.9 and later):
git config --global alias.up 'pull --rebase --autostash'
Next you can simply use :
git up
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents