git分支的重新推存周期 [英] Rebase-push cycles for git branches

查看:168
本文介绍了git分支的重新推存周期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用一个基于另一个存储库主分支的单个分支的github存储库。 github分支是我工作的一个备份,绝对不意味着拉取,因此我很乐意在从主存储库重新绑定时重写它的历史。



我的问题是我想要一个清晰的历史记录,如果历史分歧,我不能这样做。这发生在我推送(初始工作)+ rebase - 第二次推送被拒绝的情况下。



我尝试删除分支然后推送,但是这有讨厌的副作用,做一个下降创建回购,这是缓慢的。



我应该如何解决这个问题?

-f 或 git-push code> - force 告诉它强制推送远程ref(分支)到本地值。


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?

解决方案

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.

这篇关于git分支的重新推存周期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆