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

  • SEARCH
  • Home
  • 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 1007825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T08:40:37+00:00 2026-05-16T08:40:37+00:00

I’m just starting with git and using it to interact with an SVN repository.

  • 0

I’m just starting with git and using it to interact with an SVN repository. The svn repo is in a standard format so I configured my sandbox as

git svn clone <repo> -s

All seemed fine initially but after several rebases, dcommits and tags I appear to be always commiting to an SVN tag. Doing a dcommit dry run returns:

$ git svn dcommit --dry-run
Committing to http://proj.badc.rl.ac.uk/svn/badc/users/spascoe/metaconfig/tags/0.1.1 ...
diff-tree a1265119164b79cfb12d28a7059d453fb4eb13f7~1 a1265119164b79cfb12d28a7059d453fb4eb13f7

My .git/config is:

[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
    autocrlf = false
[svn-remote "svn"]
    url = http://proj.badc.rl.ac.uk/svn/badc
    fetch = users/spascoe/metaconfig/trunk:refs/remotes/trunk
    branches = users/spascoe/metaconfig/branches/*:refs/remotes/*
    tags = users/spascoe/metaconfig/tags/*:refs/remotes/tags/*

Poking around in .git isn’t helping. Any idea what’s going wrong?

  • 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-16T08:40:37+00:00Added an answer on May 16, 2026 at 8:40 am

    The git svn command had a bug where the master branch could be left pointing to something other than svn trunk when initially importing an svn repository. It was fixed in git v1.6.5 and later (in v1.6.5-rc0~75 if you have git checked out).

    If you’ve already finished checking out the svn repository and want to make sure the master branch points to svn trunk, do the following.

    NOTE: These instructions assume that you’ve committed or stashed any local changes you’ve made. Use git stash save to save any uncommitted work and git branch newbranchname to create a branch to your last commit.

    1. Switch to the master branch using git checkout master if you’re not already there. Use git branch to see your current branch, which is the one with an asterisk (‘*’) next to it.

    2. Run git svn info and check the “URL:” field. If the URL points to trunk, then you’re done. The next git svn dcommit will commit to trunk from the master branch.

    3. If git svn info points to a tag or a branch URL, run git log and find the first commit that has a “git-svn-id:” URL that points to your svn trunk URL. Copy the 40-character commit hash (on the line that starts with “commit”) that represents this commit.

    4. Reset your master branch to the commit hash using git reset --hard commit-hash replacing “commit-hash” with the commit hash from Step 3.

      NOTE: This step is the most dangerous one! Be sure you’ve saved all of your work! Make a tarball of your working directory if necessary.

    5. Run git svn info again to make sure the “URL:” field shows you’re on trunk. If it does not, you copied the wrong commit hash in Step 3. Go to Step 3 and try again.

    6. Run git svn rebase to update your master branch to the latest revision on trunk in your svn repository.

    Pro Tip: Experts will note that you can parse the “git-svn-id:” line at the bottom of each commit log to determine whether a particular commit is on trunk, on a tag or on a branch. Thus it’s sufficient to use git log master to check whether the first commit on the master branch is pointing to the trunk URL of your svn repository.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have just tried to save a simple *.rtf file with some websites and
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am reading a book about Javascript and jQuery and using one of the
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I have a text area in my form which accepts all possible characters from

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.