简体   繁体   中英

git pull with new latest tag info on the file

been trying to find out if there is a way to pre-write the tag version inside a file, so each time when i pull the code from repo, it should write the latest tag version number automatically. so i would know, which guy is using that file from which version..

is there a way to put tag information on a file , so when i retrive the file it pre-write the current tag id on it?

i have search many places, but cant find proper answer.. some way using git describe and some say use hook..

你的意思是这样吗?

git describe --tags > version.txt

您可以检查man gitattributes ,特别是filter部分。

I guess you are misunderstanding some concept on tag.

You can say, a tag is an alias of a particular SHAsum of a commit.

You can also checkout the file to a particular point through its SHAsum

git checkout <Shamsum of a point> -- <path to file>

or by tagname

git checkout <tagname> -- <path to file>

you can always keep track which one did the correction, or made commit on that particular file.

git blame -- <path to file> (the latest version)

or

git log -- <path to file> to see all the commits on that particular file

Hope this help

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM