Skip to content

Commit 069de9b

Browse files
committed
Ellaborate on synchronizing with upstream
1 parent 7576196 commit 069de9b

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

reference.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,16 @@ $ git push -f origin master <BRANCH_NAME> (23)
136136
```
137137

138138

139+
**If you are on master, (18) will fail. Now what?**
140+
141+
If you are on master branch, (18) will fail. Instead replace that line with `git pull upstream master`. This will fetch and merge the changes from upstream's master branch into your current local branch (master in this case). After that, (19-22) are unnecessary. However, don't forget to update master in your origin repository but running (23).
142+
143+
144+
**Updating other branches**
145+
146+
After you have updated your master branch (18), if you have other branches, you may need to update them as well. To do that, checkout each branch one at a time (e.g., `git checkout <OTHER_BRANCH_NAME>`) and perform (19-22) for each.
147+
148+
139149
## Squash your commits (24-25)
140150

141151
If you are following best practices, you will make many small commits as you
@@ -208,6 +218,13 @@ $ git push origin :<BRANCH_NAME> (31)
208218
```
209219

210220

221+
## Update your repositories before starting the next fix/feature (32-33)
222+
223+
OK, it's been a month since you worked on the project. Now you're back from the Bahamas and are ready to start working again. However, while you were sunning yourself, others have been hard at work contributing changes to upstream. So before you start working again, you need to update your repositories with changes from upstream. Follow steps in section _Keep your repositories up-to-date (18-23)_ to get this done.
224+
225+
Nice tan. Now get back to work!
226+
227+
211228
## References
212229

213230
[1] GitHub. _Resolving a Merge Conflict from the Command Line_. Accessed April

0 commit comments

Comments
 (0)