1

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?

2 Answers 2

3
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:
Sign up to request clarification or add additional context in comments.

Comments

0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.