简体   繁体   中英

Can Visual Studio 2013 tag a git commit with the current assembly version

I just updated a project to VS 2013 and hooked my bitbucket account into it. Everything looks to be committing and pushing fine. According to MSDN link , Git for VS 2013 doesn't support pushing tags, and say it needs to be done through the command line interface. I'd like to use tags to track the version number of my various commits, and the version number is conveniently stored in the assembly information of my project.

I'd like to commit whatever the current version number is for my project, is there any way to do this aside from manually trying it into the command line every time? I assume there isn't, but SO is fully of clever people, so I thought I'd at least ask.

I'd like to commit whatever the current version number is for my project

That isn't the adequate step for a version number: you generate it from your source control and integrate it in your build process , in order for your exe to reflect the state of the source repo.

The command to use is git describe --long .

See " Embed git commit hash in a .Net dll "

在此输入图像描述

In short, don't mix metadata about the sources (like a git tag/SHA1) with the sources themselves.
Reserve that for your exe (the end-result you are building from the sources).

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