Question screenshot
Problem description : The current pull
object does not have tracking information for remote branches;
Oral explanation : You 创建的这个分支
have not established contact with the 远程仓库
middle 其他分支
or the master
current branch, so the pull operation cannot be performed on the current branch;
Solution : git branch --set-upstream-to=origin/remote_name
local_name
annotation:
remote_name
: Remote branch name // Here is the name of the branch you create that needs to be associated with the existing branch
local_name
: Local branch // The name of the local branch you are currently creating
Problem extension: The function of the git pull command is to get the data of a remote branch or master and merge it with the local branch. Generally speaking, there are two common situations in git pull: 1 is a remote warehouse with one master, 2 is a remote warehouse with multiple branches, please see:
- The remote warehouse is a master: in this case, git pull origin master is generally performed directly;
- When the remote warehouse has multiple branches: here you need to specify a remote branch for the local current branch to associate, git branch --set-upstream-to=origin/remote_name local_name
- Others: If we use pull under a specific branch, we can
git pull origin local_name
simplify the original togit pull
, that is, it is no longer necessary to write all git command formats.