没有显示Git远程分支,所以我无法合并 [英] Git remote branch not showing, so I cannot merge

查看:624
本文介绍了没有显示Git远程分支,所以我无法合并的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我的git远程网络如下所示:



https://github.com/liuduan/CAT-APP-PROJECT /网络

 >> git branch -r 
SS-Master / master
origin / Department_Head
origin / HEAD - >原产地/主人
原产地/ HEAD_2
原产地/总统
原产地/主人

它没有显示master / ashimaSharma的分支。如何让git显示master / ashimaSharma分支?

然后我试过:

 >> git fetch --all 
获取原点
获取SS-Master

>>正在获取HEAD_2
remote:未找到
致命:存储库'https://github.com/liuduan/CAT-APP-PROJECT/commit/d54b6f1db7ff624970105fdfe5c0a1aa60a9d7b2/'找不到
错误:无法读取HEAD_2

其实我并不在乎HEAD_2分支,但我需要显示分支 master / ashimaSharma,所以我可以合并。



我从max630得到了一个删除HEAD_2的建议,我成功删除了它。



我做了获取 - 所有获取远程-v

  git remote -v 
SS-Master https://github.com/sumit0704/CAT-APP-PROJECT/(fetch)
SS-Master https://github.com/sumit0704/CAT-APP-PROJECT/(推)
原点https://github.com/liuduan/CAT-APP-PROJECT(fetch)
原点https://github.com/liuduan/CAT-APP-PROJECT(推送)

master / ashimaSharma仍未显示。

解决方案

已回答


远程分支不会显示任何已完成的工作在分叉的存储库中。在你的情况下,远程分支是Department_Head,HEAD_2,总裁和主人。如果你真的想合并ashima1491的变化,请他给你一个拉请求。



或者 -
您还可以添加另一个远程(另一个github存储库)通过使用

git remote add origin1 https://github.com/ashima1491/CAT-APP-PROJECT.git

这将添加另一个名为origin1的远程指向ashima1491的github存储库。接下来,您可以使用 -

git pull origin1 master

将她的代码拉到您的存储库中,因为您目前在您的主分支这将拉她的主分支给你的主人。然后您可以添加,提交和推送。



I tried to merge with a remote branch and I am having problems.

My git remote network looks like this:

https://github.com/liuduan/CAT-APP-PROJECT/network

>> git branch -r
SS-Master/master
origin/Department_Head
origin/HEAD -> origin/master
origin/HEAD_2
origin/President
origin/master

It did not show the branch for "master/ashimaSharma". How do I have git to show the "master/ashimaSharma" branch?

Then I tried:

>>git fetch –-all
Fetching origin
Fetching SS-Master

>>Fetching HEAD_2
remote: Not Found
fatal: repository 'https://github.com/liuduan/CAT-APP-PROJECT/commit/d54b6f1db7ff624970105fdfe5c0a1aa60a9d7b2/' not found
error: Could not fetch HEAD_2

Actually I do not really care about HEAD_2 branch, but I need to show the branch "master/ashimaSharma", so I can merge.

I got a suggestion from max630 to remove HEAD_2, and I removed it successfully.

I did "get fetch –-all", and "get remote -v",

git remote -v
SS-Master       https://github.com/sumit0704/CAT-APP-PROJECT/ (fetch)
SS-Master       https://github.com/sumit0704/CAT-APP-PROJECT/ (push)
origin  https://github.com/liuduan/CAT-APP-PROJECT (fetch)
origin  https://github.com/liuduan/CAT-APP-PROJECT (push)

But the "master/ashimaSharma" is still not showing up.

解决方案

Answered here.

Remote branch won't show any work done in the forked repositories. In your case the remote branches are Department_Head, HEAD_2, President and master. If you really want to merge "ashima1491"'s changes, ask him to send you a pull request.

Alternatively - You can also add another "remote" (the other github repository) by using
git remote add origin1 https://github.com/ashima1491/CAT-APP-PROJECT.git
This will add another remote named "origin1" which points to ashima1491's github repository. Next you can pull her code to your repository using -
git pull origin1 master
given you are currently at your master branch this will "pull" her master branch to your master. You can then add, commit and push.

这篇关于没有显示Git远程分支,所以我无法合并的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆