Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git: Can I get the equivalent of an RCS $Id$ string?

I have a program that is distributed as a single file, and doesn't go through an installation procedure.

Is there a way to have git embed an RCS-like $Id$ string? Checkin timestamp, etc, would also be fine, just something to easily id files in the field. Github-specific solutions are acceptable.

like image 208
Mark Harrison Avatar asked Oct 16 '25 15:10

Mark Harrison


1 Answers

Git support keyword expansion for $Id$ which will be replaced with the SHA value of the file when you do a git checkout. If this is not sufficient you can write a custom content filter. For more details see https://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes#Keyword-Expansion

like image 75
joran Avatar answered Oct 18 '25 06:10

joran



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!