There are three types of branches in git:
-
local branch
The local branch is the branch we usually operate. The default in git is the master branch
Create a branch: git branch b1
Switch branches: git checkout b1
-
remote branch
It actually points to a branch on the remote server and is used to track changes in the remote branch
-
tracking branch
A tracking branch is a local branch that has a direct connection with a remote branch (local bookmarks, aliases of the remote branch), and a tracking branch is a local branch
-
When we use the git pull command on the tracking branch, it will automatically fetch from the corresponding remote branch, and then merge to the branch. If we want to use the git push command directly on the tracking branch, let it automatically push to the corresponding remote On branch, when we use the git clone command, a master branch will be automatically created locally to track origin/master.