2

I have some Python scripts that have an $Id$ field set by .gitattributes at checkout. How can I use this ident string to check out (or otherwise identify) the specific version of the file?

The problem arises when a client uses a script, but isn't sure which version they've checked out. It would be nice to just ask for the $Id: ... $ and see which version they're using.

Mike Morearty
  • 9,953
  • 5
  • 31
  • 35

1 Answers1

0

The string after $id: is the SHA of the contents of the file. So you can simply do:

git show <SHA>

which will show you the contents of the file identified by SHA.

seumasmac
  • 2,174
  • 16
  • 7