Reputation: 24824
with git svn
I can use a svn repository with git. In svn, I can get version of revision with
svnversion
how I can get the version of svn revision with git svn
?
Upvotes: 1
Views: 247
Reputation: 343
The @Vampire answer is pretty good, I'd just like to include just one more command, in case you want to get the revision of a specific commit, instead the last one of the repository:
git svn log
This command will list all the commits that you have into the SVN repository, giving the SVN revision, author, timestamp, lines edited, and the commit message.
Upvotes: 0
Reputation: 38734
git svn info | grep '^Revision: ' | cut -c 11-
git svn info
displays some information including the current revisiongrep '^Revision: '
extracts from this the line where the current revision is mentionedcut -c 11-
extracts the actual revision number from it by cutting off the first 10 characters which are Revision:
Upvotes: 3