问题:
MacBook-Air t113Code % git pull
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.
git pull <remote> <branch>
If you wish to set tracking information for this branch you can do so with:
git branch --set-upstream-to=origin/<branch> main
原因及解决方法:
原因:
你当前所在的分支 没有设置上游分支(即 tracking 信息),所以 git pull 不知道要从哪个远程分支拉取代码。
解决方法:
git branch
当前所在的分支会有一个 * 标记,比如:
* main
如果你是 main 分支,却想跟踪远程的 master 分支,那也可以这么设置:
git branch --set-upstream-to=origin/master main
2193

被折叠的 条评论
为什么被折叠?



