Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use tags for versioning in git gui

Tags:

I'm a complete and utter noob, so be gentle!

I'm using git gui, and never touching the command line interface. I'm a noob, and some of the people i'm working with are even noob-ey-er...

Current state: - I have a repository on git hub which contains a handful of scripts (henceforth 'code')
- I'm using git gui (mysysgit)
- I have made commits and push's and have a vague understanding of CVS
- I don't believe we will need to branch

I feel that I should be able to use tags to create versions of the code. I also 'feel' like there should be an equivelant structure in the filesystem where the snapshots (or links to...) are stored.

eg:
.\EdsLittleThing\v1.0
.\EdsLittleThing\v1.1
.\EdsLittleThing\v1.2
etc

However, I can not work out how to create a tag within git gui. The only tag reference i can find seems to be tied to merging branches, and that doesn't help me.

I have scoured the web, and can not find a single reference on how to create and manage versions using Git Gui.

I want to be able to create a slightly more simple version of this: branch and tag structure

Final note: Whilst I'm led to believe that my answer is found in 'tags', I dont really care if its really answered by using revisions / branches / whatever.

like image 518
Edwood Avatar asked May 27 '11 23:05

Edwood


People also ask

How do I add a tag to GitHub GUI?

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

What is tag version in git?

Tags are ref's that point to specific points in Git history. Tagging is generally used to capture a point in history that is used for a marked version release (i.e. v1. 0.1). A tag is like a branch that doesn't change. Unlike branches, tags, after being created, have no further history of commits.

How do I assign a tag in git?

In order to create a Git tag for the last commit of your current checked out branch, use the “git tag” command with the tag name and specify “HEAD” as the commit to create the tag from. Similarly, if you want your tag to be annotated, you can still use the “-a” and “-m” options to annotate your tag.

How will you list your tags in git?

List Local Git Tags. In order to list Git tags, you have to use the “git tag” command with no arguments. You can also execute “git tag” with the “-n” option in order to have an extensive description of your tag list. Optionally, you can choose to specify a tag pattern with the “-l” option followed by the tag pattern.


2 Answers

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.

like image 181
Seth Robertson Avatar answered Oct 28 '22 23:10

Seth Robertson


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!

like image 38
Edwood Avatar answered Oct 29 '22 00:10

Edwood