Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The <code>git svn</code> 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 <a href="http://git.kernel.org/?p=git/git.git;a=commit;h=b186a261b1f7ec1fbda8c5f6d84595f3a7716d92" rel="nofollow noreferrer">v1.6.5-rc0~75</a> if you have git checked out).</p> <p>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.</p> <p><strong>NOTE:</strong> These instructions assume that you've committed or stashed any local changes you've made. Use <code>git stash save</code> to save any uncommitted work and <code>git branch newbranchname</code> to create a branch to your last commit.</p> <ol> <li><p>Switch to the master branch using <code>git checkout master</code> if you're not already there. Use <code>git branch</code> to see your current branch, which is the one with an asterisk ('*') next to it.</p></li> <li><p>Run <code>git svn info</code> and check the "<code>URL:</code>" field. If the URL points to trunk, then you're done. The next <code>git svn dcommit</code> will commit to trunk from the master branch.</p></li> <li><p>If <code>git svn info</code> points to a tag or a branch URL, run <code>git log</code> and find the first commit that has a "<code>git-svn-id:</code>" 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.</p></li> <li><p>Reset your master branch to the commit hash using <code>git reset --hard commit-hash</code> replacing "<code>commit-hash</code>" with the commit hash from Step 3.</p> <p><strong>NOTE:</strong> 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.</p></li> <li><p>Run <code>git svn info</code> again to make sure the "<code>URL:</code>" 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.</p></li> <li><p>Run <code>git svn rebase</code> to update your master branch to the latest revision on trunk in your svn repository.</p></li> </ol> <p><strong>Pro Tip:</strong> Experts will note that you can parse the "<code>git-svn-id:</code>" 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 <code>git log master</code> to check whether the first commit on the master branch is pointing to the trunk URL of your svn repository.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload