简体   繁体   中英

store tag value from git repo into file

I am new to git and I have a repo stored on git. I want to implement version control the tag value that is available on git.

I have a file called version.rb which specifies the version of the plugin that I am currently using, which look like this :

Version = "0.1.0"

and the tag associated with this commit would be "0.1.0" .

Issue :

  Sometimes when I create a new tag for the repo, I would forget to update the value of `Version` in version.rb.

I want to update the Version value in version.rb to be the same value as a the tag value on the repo. Is there a way to do this?

Changing a file in a tagged commit does not make the changed file part of the previously tagged commit. So if you change version.rb you still have to create another tagged version of your repo.

Looks like you just have to remember to bump the version in version.rb .

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