git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Moving commits from one branch to another

From
John Keeping <john@keeping.me.uk>
Date
Jan 23, 2013, 12:12 UTC
Message-ID
<20130123121203.GM7498@serenity.lan>
In-Reply-To
<000a01cdf961$bcf773d0$36e65b70$@de>
On Wed, Jan 23, 2013 at 01:04:03PM +0100, Stefan Schulze wrote:
Show 15 quoted lines
> my team uses a central git-repo since >1500 commits and now we have to sync
> (only one-way is necessary for now) our repository every three weeks with an
> external svn-repo.
> I created the new base-directory (incl. trunk/tags/branches) in svn and
> added it to my local repo using git svn init && git fetch.
> Now I have two branches in my local repository (master and "svnbranch") and
> cherry-picked the very first commit from master to svnbranch (it was
> probably not necessary), tagged this commit as "publishedToSvn". Now I want
> to add all commits publishedToSvn..master onto svnbranch. I didn't managed
> to succeed using git-rebase (probably because of the missing common
> commits?) and using git grafts / filter-branch modifies my already published
> master.
> 
> Is there any way to move/copy commits from one branch to another without a
> common base-commit and without a forced push of master?

Did you try "git rebase" with "--onto"? You probably want something like this:

    git rebase --onto svnbranch publishedToSvn master
John
Previous: Stefan SchulzeNext: Stefan Schulze
Message 2 of 5 in “Moving commits from one branch to another”
  1. Stefan SchulzeJan 23, 2013
  2. John KeepingJan 23, 2013
  3. AW: Moving commits from one branch to anotherStefan Schulze, Jan 23, 2013
  4. John KeepingJan 23, 2013
  5. AW: Moving commits from one branch to anotherSchulze, Stefan, Jan 23, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.