git creating a branch and remote branch association

1, the new local branch:

 

 

As shown, then enter your branch name, and then choose which branch to pull the code from the remote, such as the selection master

 So far local branch created.

 

2, associated with the remote branch:

(1), first enter git branch -vv, take a look at the relationship between branch and remote branch.

Dark blue is the remote branch can be associated. Then see useGit this branch we just created and not associated with remote branch

(2) the input git branch -u origin / Iterate

This command is associated with the current local branches to remote branches. You might sprout new wonder why you want to associate to a remote branch ah? Because the association to the remote branch you can push the code to the remote branch, and others will be able to pull down.

Success, then you can happily push code.

Guess you like

Origin www.cnblogs.com/caoshufang/p/11121017.html