git 分支的变基推送周期
我目前正在使用带有单个分支的 github 存储库,该分支基于另一个存储库的主分支。 github 分支是我工作的备份,绝对不是为了拉取,因此我很乐意在从主存储库重新建立基础时重写其历史记录。
我的问题是我想要一个干净的历史,如果历史有分歧我就不能这样做。如果我执行推送(初始工作)+变基,就会发生这种情况 - 第二次推送被拒绝。
我尝试删除分支然后推送,但这会产生删除创建存储库的令人讨厌的副作用,速度很慢。
我应该如何解决这个问题?
I'm currently using a github repository with a single branch, based of a master branch of another repository. The github branch is a backup of my work, and definitely not meant for pulling, and as such I'm comfortable with rewriting its history when rebasing from the master repository.
My problem is that I want a clean history, and if histories diverge I can't do that. This happens if I do a push ( initial work ) + rebase - the second push is rejected.
I have tried to delete the branch and then push, but this has the nasty side effect of doing a drop-create of the repo, which is slow.
How should I approach this problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
git-push
可以接受选项-f
或--force
来告诉它强制推送以将远程引用(分支)更新为本地价值。git-push
can accept option-f
or--force
to tell it to force the push to update the remote ref (branch) to the local value.