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.
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.
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.
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.
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' .
(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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With