打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
git pull push没有指定branch报错的解决方法
git 执行git push 和git pull的操作时候,经常看到下面的提示:

You asked me to pull without telling me which branch you
want to merge with, and 'branch.dev.merge' in
your configuration file does not tell me, either. Please
specify which branch you want to use on the command line and
try again (e.g. 'git pull <repository> <refspec>').
See git-pull(1) for details.

If you often merge with the same branch, you may want to
use something like the following in your configuration file:

[branch "dev"]
remote = <nickname>
merge = <remote-ref>

[remote "<nickname>"]
url = <url>
fetch = <refspec>

See git-config(1) for details.

 

在高版本的 git下面,也许会看见这样的提示:

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 master origin/<branch>

看到第二个提示,我们现在知道了一种解决方案。也就是指定当前工作目录工作分支,跟远程的仓库,分支之间的链接关系。

比如我们设置master对应远程仓库的master分支

git branch --set-upstream master origin/master

这样在我们每次想push或者pull的时候,只需要 输入git push 或者git pull即可。

在此之前,我们必须要指定想要push或者pull的远程分支。

git push origin master

git pull origin master.

 

 

  Source url:http://www.netroby.com/view.php?id=3203
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
Git查看、删除、重命名远程分支和tag | zrong's blog
在GitHub上管理项目
Git远程分支和refs文件详解
链接github
git之Pushing to the remote branch is not fast-forward错误解决
The current branch is not configured for pull No value for key branch.master.merge found in configur
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服