Git-svn and local branches

I usually use git for version control, but right now I'm stuck in the sources in the svn repository, so I use git-svn to access this repository. However, this leads to some problems when I try to use local branches.

Usually I only commit my local repositories about once a day, so I could complete my local master, which has not yet been sent upstream. When I create a branch at this point, and then someone else makes the transition to the upstream repository, all transactions between the current and the last that were synchronized up are duplicated.

To make this clearer here is a short image:

A-B-C-D-E  
     \  
      \-F

The upstream repository is at point A, and the two branches are at E and F, respectively. Running git svn rebase results in:

A-G-H-B-C-D-E
 \
  \-B-C-F

G H - , . , git svn. :

A-G-H-B-C-D-E
 \
  \-G-H-B-C-F

, . ?

+5
2

git rebase , , . , , , F , . , git rebase, .

(n.b. , B s, C s .. .)

git svn rebase

, git svn rebase, :

A-G-H-B'-C'-D'-E'
 \
  \-B-C-F

:

git rebase --onto C' C F

... :

A-G-H-B'-C'-D'-E'
\          \
 \-B-C-F    \-F'''

git svn rebase

git svn rebase, :

A-G-H-B'-C'-D'-E'
 \
  \-G'-H'-B''-C''-F''

:

git rebase --onto C' C'' F''

:

A-G-H-B'-C'-D'-E'
 \         \
  \          \- F'''
   \
    \-G'-H'-B''-C''-F''

... G' F''.


, , , - . , :

git checkout -b new-experiment C'
git cherry-pick F

, .

+1

'git svn rebase' 'git svn dcommit', . svn . . "REBASE VS. PULL/MERGE" http://git-scm.com/docs/git-svn.

+1

All Articles