Skip to content

Commit 6f82b9f

Browse files
committed
Provide more detailed explanation of upstream
Incorporates wording from @srerickson. Thank you!
1 parent 775b768 commit 6f82b9f

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

episodes/03-sharing.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -414,11 +414,14 @@ Why didn't we use the same command both times?
414414

415415
::::::::::::::::: solution
416416

417-
The first time, Git didn't know where to push the changes, so we had to tell it the destination to use.
418-
We also used the `-u` flag to tell Git to remember that decision.
419-
420-
The second time, Git knew a destination it could use, so we didn't specify one;
421-
not only did we save on typing, we also avoided worries about typing the wrong destination.
417+
Branches can be configured with an "upstream" branch (a branch on a remote repository),
418+
which is used automatically for `push` and `pull` operations.
419+
420+
The `main` branch's upstream wasn't set when we created it.
421+
The `-u` (or `--set-upstream`) flag tells `git push` which remote branch to use;
422+
it also sets the remote branch as the local branch's upstream.
423+
Once we've set it, we don't need to specify the remote branch in future `push` and `pull` operations.
424+
This saves on typing and means we won't `push` to or `pull` from the wrong remote branch.
422425

423426
::::::::::::::::::::::::::
424427

0 commit comments

Comments
 (0)