2016-12-15 49 views
1

昨晚我在github存儲庫中提交併推送了一些更改到master中。我檢查了(只是爲了確定),並且發生了變化。該貢獻也在https://github.com/url_sample/commits/master 上顯示今天我看到另一個團隊成員推進了一些更改。這裏怪異的部分是,不僅我所有的改變都在這個版本中丟失了(畢竟這並不奇怪)。我似乎無法在任何地方找到我的貢獻(如在存儲庫歷史記錄中)。我在github上的推送已經消失

有沒有一種方法,一個已經成功的推簡單消失?

+0

您可以搜索這些關鍵字組合:「混帳推力「,你會得到你的答案。 –

回答

1

如果其他開發者拉你的changes/commits。撤銷您的提交(hard reset),然後force push to remote。該方案是:

$ git checkout master 
$ git pull origin master 

$ git reset --hard HEAD~1   # undo last commit 
$ git push -f origin master  # replace remote/master with local/master 
0

要強制推動遠程倉庫你的本地修改

git push -f <remote> <branch> 

要力推你也可以這樣做:

git push <remote> <branch> -f 
git push origin master -f # Example 

git push <remote> -f 
git push origin -f # Example 

git push -f 

git push <remote> <branch> --force-with-lease