不成功的git推 - 不能再推了

时间:2014-05-24 16:02:26

标签: git

我想将提交推送到两个存储库中,如下所示:

[remote "origin"]
    url = https://mrtnzlml@bitbucket.org/mrtnzlml/www.zeminem.cz.git
    url = https://github.com/mrtnzlml/www.zeminem.cz.git
    fetch = +refs/heads/*:refs/remotes/origin/*

直到今天(几乎)完美地工作。上次推送(通过PhpStorm IDE)导致此错误:

Push failed
error: Connection time-out while accessing https://mrtnzlml@bitbucket.org/mrtnzlml/www.zeminem.cz.git/info/refs?service=git-receive-pack
fatal: HTTP request failed

不幸的是,远程服务器上没有这些提交,我再也看不到它们在localhost上(使用git status)。但是我找到了get reflog命令:

91a20c9 HEAD@{0}: checkout: moving from pictures to develop
7829ccc HEAD@{1}: commit: WP like pictures draft
e59196f HEAD@{2}: checkout: moving from develop to pictures

如何跳回7829ccc提交(没有数据丢失)并尝试重新推送?我找到了一些荒谬的解决方案,例如。制作新的git clone并从旧项目中复制更改,但我不想这样做......

1 个答案:

答案 0 :(得分:1)

Yaay! ( - :我终于解决了这个问题,感谢this question

所以解决方案实际上很简单:

git push origin 7829ccc:pictures
相关问题