Stash your local changes: git stash Update the branch to the latest code git pull Merge your local changes into the latest code: git stash apply Add, commit and push your changes git add git commit git push