Note that there are some explanatory texts on larger screens.

plurals
  1. POWhat is the correct way to convert SVN remote branches and tags into local Git branches/tags during SVN to Git migration
    primarykey
    data
    text
    <p>What is the correct way to make the remote branches/tags that exist after a git-svn init/git-svn fetch into local Git branches/tags before pushing to my remote Git repo and abandoning SVN altogether.</p> <p>I have:</p> <ul> <li>Run <code>git svn init</code> </li> <li><p>Updated the <code>svn-remote "svn"</code> section of my .git/config file to the following:</p> <pre><code>url = file:///Users/Developers/git_transition/svn_repo fetch = cascade/trunk:refs/remotes/svn/trunk branches = cascade/branches/{5.0GA_CLEANUP,drag-n-drop-def-builder,help-text,hib-annotations,hibernate-annotations,image-editor,ldapconfig,liquibase,move-rename-prototype,progress-bar,progress-bar2,quartz-upgrade,recyclebin,rendering_metrics,shuttle_upgrade,spring3,web-services-no-nuller}:refs/remotes/svn/* branches = cascade/branches/{6.x,5.x,4.x,3.x,archive}/*:refs/remotes/svn/* tags = cascade/tags/{3.7.x,4.x,5.x,6.x,old-releases}/*:refs/remotes/svn/tags/* </code></pre></li> <li><p>Run <code>git svn fetch</code></p></li> </ul> <p>Does <code>git-svn clone</code> do something beyond init/fetch that turns these branches/tags into local ones?</p> <p>I tried the <a href="http://progit.org/book/ch8-1.html" rel="noreferrer">advice on Pro Git</a> but there was nothing in the .git/refs/remotes/svn/ directory except the empty 6.x, 5.x, 4.x, 3.x, tags, and archive directories. I did verify that the remote branches are there with <code>git branch -r</code>.</p> <p>Someone suggested that I needed to systematically checkout all of the remote branches as local ones: <code>git checkout -b &lt;local_branch_name&gt; &lt;svn_remote_branch_name&gt;</code> but I haven't gotten a definitive answer anywhere.</p> <p>I <strong>have</strong> been able to conver the tags by using this script:</p> <pre><code>git for-each-ref --format="%(refname)" refs/remotes/svn/tags/6.x | grep -v @ | while read tag; do GIT_COMMITTER_DATE="$(git log -1 --pretty=format:"%ad" "$tag")" GIT_COMMITTER_EMAIL="$(git log -1 --pretty=format:"%ce" "$tag")" GIT_COMMITTER_NAME="$(git log -1 --pretty=format:"%cn" "$tag")" git tag -m "$(git log -1 --pretty=format:"%s%n%b" "$tag")" ${tag#refs/remotes/svn/tags/6.x/} "$tag"; done </code></pre> <p>for each of the tags folders.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    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.
 

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