Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Will too many tags cause any issues in Git?

Tags:

git

I have to create several tags every day in a Git repository.
When I have lots of tags, will it make my repository sluggish or cause other issues?

Note: I'm using GitHub, but please answer generically.

like image 744
ML-- Avatar asked May 16 '12 05:05

ML--


People also ask

Can a git commit have multiple tags?

To push multiple tags simultaneously pass the --tags option to git push command. When another user clones or pulls a repo they will receive the new tags.

Are git tags useful?

A big reason for Git's popularity is its seamless ability to create branches. Development teams can use branches to work on specific features or releases. However, Git's tag is an often overlooked command that can help teams simplify their workflows.

What does tagging do in git?

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.

Do git tags have to be unique?

Tags are completely separate from branches, so how you choose to handle tags doesn't depend on how you choose to handle branches. You can apply a tag to branch E' and safely delete test_branch , without losing the code in E' .


2 Answers

(Annotated) tags won't make Git sluggish, only harder to use in that you will have an harder time to find relevant tags amongst all the intermediate ones.

Worst case, it can make your web interface (like GitHub) sluggish if it has to display thousands of tags.

Maybe all those tags don't need to be pushed, in which case you could consider making intermediate local "Lightweight" tags.

like image 126
VonC Avatar answered Sep 22 '22 18:09

VonC


Using Git 2.8.1 on Windows, I have experienced minor slowness from certain commands when there are lots of tags (15000 or so), including:

  • git log (with --decorate)

  • git status

  • Viewing history in Visual Studio.

  • Using the command prompt when head is detached (since Git Bash pretty-prints the current revision next to the current directory).

These commands all examine tags to decorate revisions shown. Each of these commands takes about 1-2 seconds longer than without the tags.

Update: Running git gc (without --prune as I had been) greatly sped up Git. The real culprit may have been frequent rebasing.

like image 31
Joey Adams Avatar answered Sep 23 '22 18:09

Joey Adams