Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4083778
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:21:22+00:00 2026-05-20T18:21:22+00:00

I usually using git for versioning, but right now I am stuck with sources

  • 0

I usually using git for versioning, but right now I am stuck with sources in a svn repository, so I am using git-svn to access that repository. However this seems to lead to some trouble, when I try to use local branches.

I usually only commit my local repositories about once a day, so I might have commits in my local master, that I have not yet send upstream. When I create a branch at this point, and then someone else commits to the upstream repository, all commits between the current one and the last one that was synced upstream get duplicated.

To make this clearer here a short picture:

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

The upstream repository is at A and the two branches are at E and F respectively. Doing a git svn rebase leads to:

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

Where G and H are the commits that were taken from the upstream repo. I already tried to get the two commits to the other branch as well by switching there and doing another git svn rebase. But this leaves me there:

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

So this leads to even more duplication of commits. Is there a clean way to handle this situation?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T18:21:23+00:00Added an answer on May 20, 2026 at 6:21 pm

    You can use git rebase to reapply any range of commits onto any particular commit, which sounds like what you want here. This technique works for moving any range of commits, but as I mention at the bottom, if you really only have a single commit F on your branch, then it’s easier to just cherry-pick. However, first I’ll describe how you would do it with git rebase, since that’s more generally useful.

    (n.b. I’m going to rename your commits slightly since the two Bs, Cs, etc. will have different commit IDs after rebasing.)

    After the first git svn rebase

    So, if you were wanting to do this rebasing after the first git svn rebase you would be in the situation:

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

    At this point, you could have done:

    git rebase --onto C' C F
    

    … which would have created:

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

    After the second git svn rebase

    If the situation is as you describe after the second git svn rebase, that would look like this:

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

    In that case you could similarly do:

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

    To create the graph:

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

    … and you can just forget about G' through to F''.


    However, in both of these cases, you’re only moving a single commit, so it’s probably easier to cherry-pick the commit. In other words, you could do:

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

    I hope that’s of some use.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been using Git for some time now to manage my own personal
I've been using git for a while for my one-man developments, but I haven't
I'm using cygwin-git locally inside a CVS repository on Windows at my workplace, in
I'm using Git as the repository for my hosted-server web application. I know the
Usually when using any web page that is used to search for huge amount
I heard lots of times virtual function is usually implemented using a vtable. But
We are currently using SVN to develop an internal application that has most of
Usually I'm using One-to-many relationship by this way : class Study { static hasMany
I usually script/program using python but have recently begun programming with JavaScript and have
Under Windows XP WPF true 3D content (which is usually displayed using the Viewport3D

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.