Git: git branch -- set-upstream
When git creates a new branch locally and pushes it to the remote server, the following prompt will be reported if it is not processed again:
You asked me to pull without telling me which branch youwant to merge with, and 'branch.production.merge' inyour configuration file does not tell me, either. Pleasespecify which branch you want to use on the command line andtry again (e.g. 'git pull <repository> <refspec>').See git-pull(1) for details. If you often merge with the same branch, you may want touse something like the following in your configuration file: [branch "debug"] remote = <nickname> merge = <remote-ref> [remote "<nickname>"] url = <url> fetch = <refspec> See git-config(1) for details.
Problem Analysis:
After creating a local branch in git, you must perform remote branch association. If no association exists, git will prompt you to add the association in the following operations. The purpose of association is to operate on the local branch: git pull and git push. You do not need to specify the remote branch in the command line. after being pushed to a remote branch, you will be prompted when git pull is not displayed.
Solution:
Run git branch -- set-upstream; the instance is as follows, where debug is the branch
git branch --set-upstream debug origin/debug
The final modification of the command is for the config file.
Use -- set-upstream to track remote branches.
[core]repositoryformatversion = 0filemode = truebare = truelogallrefupdates = true[remote "origin"]fetch = +refs/heads/*:refs/remotes/origin/*url = git@192.168.1.160:android2.3.5_r1.git[branch "master"]remote = originmerge = refs/heads/master[branch "debug"]remote = originmerge = refs/heads/debug[receive]denyCurrentBranch = ignore
Note the config file in the repository. git directory.