1. View remote branches
Use the following git command to view all remote branches:
git pull
git branch -r
2. Pull remote branches and create local branches
Method 1
Use the following command:
git checkout -b local branch name x origin/remote branch name x
Using this method will create a new branch x locally and automatically switch to the local branch x.
The local branch established in this way will establish a mapping relationship with the remote branch.
Method 2
Use the following command:
git fetch origin remote branch name x: local branch name x
Using this method will create a new branch x locally, but will not automatically switch to the local branch x, you need to checkout manually.
The local branch established by this method will not establish a mapping relationship with the remote branch.
3. The role of mapping between local branches and remote branches
https://blog.csdn.net/tterminator/article/details/52225720
git pull remote branch
Guess you like
Origin http://43.154.161.224:23101/article/api/json?id=326058781&siteId=291194637
Recommended
Ranking