Hacker News new | past | comments | ask | show | jobs | submit login

  $ 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!



For 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




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: