Syncing with a remote repo in Git
My latest workflow…
- Check for local changes.
$ git status
- Commit or stash them. Rebase won’t work with local changes.
$ git stash save 'local env settings'
- Pull down remote changes and rebase my changes off them.
$ git pull --rebase
- Get my local changes back.
$ git stash pop
- Test that everything still works!
- Push changes back to the remote repo.
$ git push origin
Update: Changed stash apply
to stash pop
, to avoid creating an infinite number of stashes.