File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments