我做了一個提交。然後意識到我忘了添加一個文件,所以我做了git commit --amend -C HEAD
。然後我推到遠程回購。問題是我忘了我也將未修改的提交推送到遠程,所以現在有衝突。我怎樣才能解決這個問題?撤消git commit --amend
0
A
回答
1
推時使用--force
標誌:
git push --force origin master
注:
master
可能需要通過您的分行名稱所取代。而origin
可能需要通過遠程名替換,但可能你並不需要去改變它
2
通過pedrorijo91答案改寫歷史的大衆,也不會在一些偏遠的配置被允許(拒絕非快前鋒)。如果其他用戶有權訪問推送的代碼,則最好撤銷git reset --soft @{u}
的修訂,並使用索引中的更改創建新提交
相關問題
- 1. 如何中止'git commit --amend'?
- 2. git commit -amend without ask for message
- 3. 如何跳過「git commit --amend」中的提交消息步驟?
- 4. 撤消git add和git commit以及一種git push原點
- 5. 「git commit --amend」without「git add」/正在更改臨時區域
- 6. 撤消git的承諾
- 7. 如何在git中「撤消撤消」?
- 8. 有沒有相當於`git commit --amend`的Bazaar?
- 9. 撤消git存儲,git pull
- 10. Git - 撤消更改
- 11. 撤消git合併
- 12. git撤消更改
- 13. 撤消'git push'的問題
- 14. 撤消在GIT中刪除
- 15. 撤消多個git合併
- 16. Git - 撤消所有更改更改
- 17. ^在Git commit消息中的M個字符(git commit -v)
- 18. Git後提交:跳過--amend和rebase
- 19. 如何撤消git svn dcommit?
- 20. 撤消的Git track命令
- 21. Git:如何「撤消」合併
- 22. 撤消git am的--abort
- 23. GIT撤消分支-D
- 24. 撤消推git的合併
- 25. 撤消git平分錯誤
- 26. 撤消在GIT結帳
- 27. 需要撤消GIT提交
- 28. Git撤消上次提交
- 29. GIT:如何撤消合併?
- 30. 如何撤消git mixed reset?
這被認爲是危險的:https://developer.atlassian.com/blog/ 2015/04 /力與租賃/ –