2018-02-05 02:27:07 +00:00
|
|
|
# Example: Updating a fork
|
|
|
|
|
2019-11-23 16:05:04 +00:00
|
|
|
```bash
|
2018-02-05 02:27:07 +00:00
|
|
|
# On the fork:
|
|
|
|
git checkout master
|
|
|
|
|
|
|
|
git pull upstream master
|
|
|
|
|
|
|
|
git push origin master
|
|
|
|
|
|
|
|
# If the branch should be created.
|
|
|
|
git checkout -b new_branch
|
|
|
|
git push -u origin new_branch
|
|
|
|
|
|
|
|
# If the branch already exists.
|
|
|
|
git checkout branch_name
|
|
|
|
git merge master
|
|
|
|
|
|
|
|
# If there are conflicts:
|
|
|
|
# Uses the default merge tool against all conflicts, one at a time.
|
|
|
|
git mergetool
|
|
|
|
# Uses the default merge commit message.
|
|
|
|
git commit --no-edit
|
|
|
|
```
|