如何同时使用github和gitshell?能不能一次commit,两个一起更新啊?

2013-05-08 15:28:01 +08:00
 eastfox2002
由于github速度比较慢,所以想主力用gitshell,然后github做备份,有没有什么办法可以一次commit,两边一起更新?
3628 次点击
所在节点    git
13 条回复
ShadowStar
2013-05-08 16:03:52 +08:00
如果你的需求是一个push同事push到多个url的话,修改config文件
[remote "origin"]
url = URL/TO/GITHUB
url = URL/TO/GITSHELL
eastfox2002
2013-05-08 16:12:02 +08:00
感谢哥们,我刚尝试了下,发生了这样的问题
失败了,问题如下:
[remote "all"]
url = git@github.com:eastfox2002/ruby.git
url = git@gitshell.com:eastfox2002/ruby.git
问题
ERROR: Repository invalid.
fatal: The remote end hung up unexpectedly

如果是单独url,都可以,求助,谢谢
davepkxxx
2013-05-08 16:30:37 +08:00
没有办法吗?
ShadowStar
2013-05-08 16:33:45 +08:00
@eastfox2002 你的Git的版本是多少?
我的版本是「git version 1.7.12.4 (Apple Git-37)」
eastfox2002
2013-05-08 16:39:03 +08:00
@ShadowStar 我的是git version 1.7.4.4 难道太老了,我更新试试,谢谢
mingzhi
2013-05-08 17:07:38 +08:00
@ShadowStar 的方法 可以吧。。
我就是这么搞的。。
thedevil5032
2013-05-08 18:10:42 +08:00
如果有代理(GA 一类的), 其实 GitHub HTTPS 的速度不错的。
chemzqm
2013-05-08 20:01:30 +08:00
是不是你命令用错了,如果你配的是all要用
git push all master 提交。
命令 git remote update 可更新所有远端源到本地
然后你自己看情况merge
slixurd
2013-05-08 21:31:16 +08:00
LS说的对
你现在用的是[remote "all"]
当然是 git push all master提交..
eastfox2002
2013-05-09 12:44:23 +08:00
@chemzqm 理论上命令应该没有用错,刚测试了下,还是不行呢。。。谢谢
ruby user$ git push all master
ERROR: Repository invalid.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
eastfox2002
2013-05-09 12:44:58 +08:00
@ShadowStar 我升级到1.8.1了。。还是失败了。。。
linzhi
2013-05-09 12:48:10 +08:00
ljbha007
2013-05-09 13:22:52 +08:00
@eastfox2002
你这个我也遇到过
当时是因为ssh-key没有加到github的profile里边
还有就是忘了开ssh-keyagent

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/68159

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX