Skip to content

Commit a69b206

Browse files
committed
Removing all peg revisions by one command
Typically one wants to keep all peg-revisions or none, so I want to propose to give the exact code line for removing all peg-revisions at once.
1 parent f016e2a commit a69b206

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

book/09-git-and-other-scms/sections/import-svn.asc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,12 @@ $ for b in $(git for-each-ref --format='%(refname:short)' refs/remotes); do git
9191
It 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.
9292
This is actually a Subversion feature called ``peg-revisions'', which is something that Git simply has no syntactical counterpart for.
9393
Hence, `git svn` simply adds the svn version number to the branch name just in the same way as you would have written it in svn to address the peg-revision of that branch.
94-
If you do not care anymore about the peg-revisions, simply remove them using `git branch -d`.
94+
If you do not care anymore about the peg-revisions, simply remove them:
95+
96+
[source,console]
97+
----
98+
$ for p in $(git for-each-ref --format='%(refname:short)' | grep @); do git branch -D $p; done
99+
----
95100

96101
Now all the old branches are real Git branches and all the old tags are real Git tags.
97102

0 commit comments

Comments
 (0)