File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
book/09-git-and-other-scms/sections Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ This makes your `import` command look like this:
3737[source,console]
3838----
3939$ git svn clone http://my-project.googlecode.com/svn/ \
40- --authors-file=users.txt --no-metadata -s my_project
40+ --authors-file=users.txt --no-metadata --prefix "" - s my_project
4141----
4242
4343Now you should have a nicer Subversion import in your `my_project` directory.
@@ -76,18 +76,16 @@ To move the tags to be proper Git tags, run:
7676
7777[source,console]
7878----
79- $ cp -Rf .git/refs/remotes/origin/tags/* .git/refs/tags/
80- $ rm -Rf .git/refs/remotes/origin/tags
79+ $ for t in $(git for-each-ref --format='%(refname:short)' refs/remotes/tags); do git tag ${t/tags\//} $t && git branch -D -r $t; done
8180----
8281
83- This takes the references that were remote branches that started with `remotes/origin /tags/` and makes them real (lightweight) tags.
82+ This takes the references that were remote branches that started with `refs/remotes /tags/` and makes them real (lightweight) tags.
8483
8584Next, move the rest of the references under `refs/remotes` to be local branches:
8685
8786[source,console]
8887----
89- $ cp -Rf .git/refs/remotes/origin/* .git/refs/heads/
90- $ rm -Rf .git/refs/remotes/origin
88+ $ for b in $(git for-each-ref --format='%(refname:short)' refs/remotes); do git branch $b refs/remotes/$b && git branch -D -r $b; done
9189----
9290
9391It may happen that you'll see some extra branches which are suffixed by `@xxx` (where xxx is a number), while in Subversion you only see one branch.
You can’t perform that action at this time.
0 commit comments