How to use tags for versioning in git gui

99封情书 提交于 2019-11-29 03:06:47

You want to use gitk, available by Repository->Visualize…

In the top pane, right click on the commit you want to tag at, and select create tag.

In the git model, you do not typically have tags checked out to disk under the same repository. You could have multiple repositories (all cloned from upstream) or the not suggested multiple working directories at different revisions with one revision, but most times simply using git's tool obviates the need to have multiple versions checked out at the same time.

What you are suggesting is nothing like the gitflow model, so I don't recommend using that as a reference. Read the ProGit book, http://progit.org for good advice and a few other workflows. I use one which is none of the above.

Typically you tag at major milestones. I tag when a piece of code becomes customer visible, or when we have code ready to move into formal QA practices. There is typically no need to tag as reminders of when things happened. That is what commit messages are for.

Thanks for the help fellas.

I managed to add tags using the method described above

You want to use gitk, available by Repository->Visualize…

In the top pane, right click on the commit you want to tag at, and select create tag.

I then had the problem that my tags were not being included in the push. Therefore, any tags I added were only stored locally, and useless for collaboration.

The last step in the process is to take one more step when you push...

When you click push, a window pops up, the bottom check box says "include tags in push". Tick this box, and you should be away laughing!

I started gitk from Git Gui, highlighted a commit (initial commit in the example below) by left clicking on it, and then right clicked on the selected commit to produce the pop-down menu shown, where the Create tag option is shown, highlighted.

A pop-up then appeared as shown further below.

If you want to add tag with Tortoise GIT:

  1. show log
  2. right click on commit and create tag at this version
  3. push with checked include tags

If you want to remove tag via Tortoise GIT:

  1. show log
  2. right click on commit and delete refs/tags/x.y.z
  3. push with empty local branch field and enter your tag name into the remote branch field

I was more interested in deleting a tag through the interface. I could not find how to do that using Git GUI, so I had to run this command on the command-line.

git tag -d [nameoftag]
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!