I have some history rewriting to do for which I'd like to keep my original tree intact for now. The rewritten tree should however copy the tags previously used as well. Is there any less manual option than e.g. prepending tag names with the branch name?
git: Is there something like per-branch tags?
5.4k Views Asked by Tobias Kienzler At
2
There are 2 best solutions below
Related Questions in GIT
- Push mysql database script to server using git
- Git show's file path
- Git > diffs filtered, show only certain changed classes/files
- Pushing to git repository hosted by Visual studio online without entering user name and password
- How do I create my own Git branch to work on?
- Git init --bare giving error fatal: Out of memory? mmap failed: No such device
- Sub-directory into independent repository and later merge back into main repository
- How to find the Git Revision Hash in a synced SVN repo using SubGit?
- eclipse errors when try to change to master git branch
- How to have Heroku build my development branch on a staging server?
- Is "Merged in" a commit message created by bitbucket, or git?
- Git: Multiple projects under one directory
- Permission denied hg-git
- Is it possible to clone a private git repo without adding ssh keys
- Track file in master repository which is ignored in submodule
Related Questions in TAGS
- How to make a multi model tag_cloud with a join table?
- Inserting template code below code in Handlebars layout.hbs
- Is it possible to access gmail anonymous profile for a logged in user?
- Youtube Google API V3: List Videos not returning video tags
- Winforms control for displaying html text
- git-svn problems creating tags
- Having an archive page with categories and tags
- How to keep comma between tags in _form?
- PHP Comment Tag
- custom WordPress tag.php page .. trying to get tag info
- Pushwoosh: how does it work
- Styling Two Navigation Bars
- git tag -l does not remove deleted tags
- unexpected end of file in html code
- <H2> followed by <Sup>
Related Questions in GIT-REBASE
- Rebasing a single commit
- rebase - automatically continue if rerere resolved all conflicts
- Rename a merged commit without losing that commit's parents
- How to make a git rebase and keep the commit timestamp?
- How can I combine 2 commits into 1 in git in a branch?
- Git Squash by author - All author commits into a single commit
- Moving selected git commits to other branches in Visual Studio
- Rebase the same branch from origin (git rebase origin/<same?>)
- How to convert a git merger into a rebase
- Error with git rebase ("could not apply...")
- git rebase <SHA1> does not seem to squash commits
- Isn't git merge --squash really git rebase -squash?
- How to resolve merge conflict while rebasing?
- git rebase --continue vs. new commit
- What is the easiest, quick and foolproof way to undo a git rebase?
Related Questions in TAGNAME
- bug regexp with element tagname?
- Get element tag name and length with Jquery each
- Difference between .tagName and .nodeName
- Sorting elements accessed via apply-templates based on the real XML tag name in XSLT
- Assigning tags by order to XML using ElementTree in Python
- A JS exception caused by 'form' element
- element.tagname doesn't return <a> on links
- accessing TagName of jquery object
- How to get all Elements from Body in VB.Net Like as <Section>?
- Is there a git max tag name length?
- How to find the value of all the id attribute of all the button elements in a web page using Selenium
- Why does the .tagName DOM property return an uppercase value?
- get value from specific tag as created c#
- How to get an element by tag name or id in Python and Selenium
- How to wait until the src attribute is defined using Selenium and Python
Related Questions in GIT-TAG
- How to display last N tags in GIT
- Circleci: How to deploy depending on git tag
- git push and fetch annotated tag does not create the tag
- How to include a commit in a tag after the tag was already created
- TFS Build tag git branch with build number
- How do I download a specific git repository tag?
- Applying the existing tag on a new commit in Git
- How can I get the latest tag of the form vX.X.X.X?
- Is there a way to lock a GIT tag?
- Git Tagging & Gitflow: What happens when you merge old commits
- Why Does GitHub Create Releases for New Tags When I Push Them to It?
- Git signing tags and log
- git pre-push hook, don't run if is --tags
- Push tags with Xcode 9
- Why should I care about lightweight vs. annotated tags?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
No, there is nothing like a per-branch tag in git. All branches and tags are just kinds of refs in Git; a ref is just a name that points to a particular revision in the revision history. For instance, if you have
develandmasterbranches, andv1.0andv2.0tags, the references would look something like this:refs/heads/devel -> * / \ * * <- refs/heads/master | | * * \ / * <- refs/tags/v2.0 | * | * <- refs/tags/v1.0 | *As you can see, there's nothing tying those tags to any branches; in fact, all of those tags are contained in both the
masteranddevelbranches. By looking inside your.gitrepo, you can see that there is really no more structure to a tag than that; it is just a file containing a SHA-1 referencing a commit within.git/refs, or a line in.git/packed-refs(tags will frequently be inpacked-refsbecause they don't change often, while branches will usually be separate files withingit/refs).So if you want to rewrite history, and preserve the old tags, you will have to rewrite your tag names. As sehe points out, this is done using
git filter-branch --tag-name-filter.