【发布时间】:2016-01-15 12:29:48
【问题描述】:
这就是我所做的:
git commit -m 'feature 1 implemented'
git push origin feature-branch
..几天后
git commit --amend --no-edit
git push -f origin feature-branch
然后我意识到功能分支包含其他人推送的提交,我只是搞砸了,因为我忘记了
git pull
我从其他问题中了解到 git push --force 可以轻松撤消
- 如果您有工作的本地副本
- 如果你能得到提交 sha
但就我而言,我不知道这些细节,我已经重写了其他提交
我知道我可以要求我的团队成员在不拉动的情况下强制更新,但仍然
有没有办法撤消--force push 和 git 拉这个数据?
【问题讨论】:
-
如果分支被多个开发人员使用,则使用带有 forse 选项的推送不是一个好主意。
标签: git github git-remote