English 中文(简体)
我怎么能改变我目前的分支是什么基础?
原标题:How can I change what branch is my current branch based off?

这里的情况是,我有三个分支:<代码>master/code>,fix#1#2,其中后两个分支各设一个具体标。

The problem is, I based fix#2 on fix#1, instead on branching from master, so it looks something like this

fix#2
|
fix#1
|
master

而不是

fix#1  fix#2
|     / 
master 

www.un.org/Depts/DGACM/index_spanish.htm 是否有任何简单的方法可以删除所有<代码>第1号。 由<代码>#2承诺 页: 1

最佳回答
git rebase --onto master fix1 fix2

但是,确保你们了解所发生的事情以及你们面前的一切后果。

<代码>git rebase -h输出:

Usage: git rebase [--interactive | -i] [-v] [--force-rebase | -f] [--no-ff] [--onto <newbase>] (<upstream>|--root) [<branch>] [--quiet | -q]

git-rebase replaces <branch> with a new branch of the
same name.  When the --onto option is provided the new branch starts
out with a HEAD equal to <newbase>, otherwise it is equal to <upstream>
It then attempts to create a new commit for each commit from the original
<branch> that does not exist in the <upstream> branch.

It is possible that a merge failure will prevent this process from being
completely automatic.  You will have to resolve any such merge failure
and run git rebase --continue.  Another option is to bypass the commit
that caused the merge failure with git rebase --skip.  To restore the
original <branch> and remove the .git/rebase-apply working files, use the
command git rebase --abort instead.

Note that if <branch> is not specified on the command line, the
currently checked out branch is used.

Example:       git-rebase master~1 topic

        A---B---C topic                   A --B --C  topic
       /                   -->           /
  D---E---F---G master          D---E---F---G master
问题回答

暂无回答




相关问题
git confusion - cloning a repo is returning a past version

Im having some confusion with my git usage. I cloned a repo from one comp to the other, and the new clone is the state of the original that was active some time ago. So its cloning a past version. ...

Appropriate strategy for tagging and hotfixing with git

I was wondering if the strategy I m using for tagging and hotfixing tags (which then I use for deploying rails applications) with git is appropriate. For tagging I just tag a commit of the master ...

Tips on upgrading CVS to git/hg?

We still use CVS, I use git and hg for my personal use though I m still a novice at both, but I realize they re much more modern and better, faster, distributed, etc. It s just everyone is so ...

Using Git in a TFS shop

Using Git at home has spoiled me - I now find using TFS at work to be a bit of a drag and want to explore the possibility of using Git locally and syncing somehow with TFS. I figure there are a few ...

热门标签