JuanPablo
JuanPablo

Reputation: 24824

Get svnversion with git-svn

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

Answers (2)

E. Nikolas de Oliveira
E. Nikolas de Oliveira

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

Vampire
Vampire

Reputation: 38734

git svn info | grep '^Revision: ' | cut -c 11-
  • git svn info displays some information including the current revision
  • grep '^Revision: ' extracts from this the line where the current revision is mentioned
  • cut -c 11- extracts the actual revision number from it by cutting off the first 10 characters which are Revision:

Upvotes: 3

Related Questions