3 ms·
$ git checkout master $ git pull $ git checkout branch-name $ git rebase master If there are merge conflicts, open the affected file(s) and resolve them.
by joshuahutt 11y ago
$ git checkout master
$ git pull
$ git checkout branch-name
$ git rebase master
If there are merge conflicts, open the affected file(s) and resolve them. Then:
$ git add filename.ext
$ git rebase --continue
Finally:
$ git push origin branch-name
If you've already pushed the branch, use -f. Make sure to always specify the branch name when using that flag!
- mcguire 11y agoFor those cases where you have created a fork of a project and are preparing a pull request, would that be something like: $ git checkout master $ git fetch upstream # https://help.github.com/articles/syncing-a-fork/ $ # git merge upstream/master # <- leaves merge commits in your fork $ git checkout branch-name $ git rebase upstream/master # Use rebase instead of merge? $ git push -f origin branch-name