二维码
微世推网

扫一扫关注

当前位置: 首页 » 快闻头条 » 科普 » 正文

git pull push没有指定branch报错的解决方法

放大字体  缩小字体 发布日期:2018-07-05 18:25:57    作者:微世推-李瑞    浏览次数:334
导读

You asked me to pull without telling me which branch youwant to merge with, and \'branch.dev.merge\' inyour configuration file does not tell me, either. Pleasespecify which branch you want to use on the

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:netroby/view.php?id=3203
 
(文/微世推-李瑞)
免责声明
• 
本文仅代表发布者:微世推-李瑞个人观点,本站未对其内容进行核实,请读者仅做参考,如若文中涉及有违公德、触犯法律的内容,一经发现,立即删除,需自行承担相应责任。涉及到版权或其他问题,请及时联系我们删除处理邮件:weilaitui@qq.com。
 

Copyright©2015-2025 粤公网安备 44030702000869号

粤ICP备16078936号

微信

关注
微信

微信二维码

WAP二维码

客服

联系
客服

联系客服:

24在线QQ: 770665880

客服电话: 020-82301567

E_mail邮箱: weilaitui@qq.com

微信公众号: weishitui

韩瑞 小英 张泽

工作时间:

周一至周五: 08:00 - 24:00

反馈

用户
反馈