You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're working on this! Initial support for this will include creating, pushing, and viewing tags in Desktop. After reading all the comments in this issue and talking with several people who feel like they're missing this, editing and deleting tags seemed fraught and had potential for unexpected things to happen between your local repo and the remote.
Is your feature request related to a problem? Please describe.
No
Describe the solution you'd like
It would be awesome to have the ability to tag commits (e.g., the equivalent to the command-line git tag <tagname>), including the ability to move, delete, edit and push up tags to remote repository.
Describe alternatives you've considered
Just the command-line.
Teachability, Documentation, Adoption, Migration Strategy
Our team uses tags consistently for build and version numbers to keep deployments consistent and more easily trackable.
Reacted by Pavel Sokolov, Jeffrey D. King, Jake Miner, Kevin Finck, Mário Garrido, Mark Francis, Steve Moser, Alessandro Gasparini, Mike Trewartha, Simon Massey and 203 more
Reacted by Denis Tomilin and Victoria
Reacted by Denis Tomilin, François VEAUVY and Victoria
Reacted by Varun Singh, Mido, Cory McArthur, gustavo-bplat, Mike, Leo Ventyk, David Lemayian, clark, Thibault Bétrémieux, Quang Lam and 33 more
Reacted by Denis Tomilin, François VEAUVY, Jona and Victoria
Reacted by Denis Tomilin, Petar Petrov and Victoria
@shiftkey is there any backend to fetch/store tags in desktop code? I really like to see the tags too and I'm deciding how hard it for me to implement it.
@crea7or before diving into the code I'd recommend starting from proposing how the user would interact with tags in the app, to illustrate the potential workflows and help size up the work.
An example of this is a mockup in an earlier thread about this: #257 (comment)
We could do something similar to dotcom and separate out branches and tags using something like a segmented control:
Going beyond "Git has feature XYZ" and walking through how a feature would look or feel in Desktop is where I'd recommend starting with this - this will help get others behind a potential solution to the problem at hand.
Reacted by Jeremy Caney, Vladislav Osmanov, wbt, Marko Čančar and Yunus Emre Ak
Why not in commit panel? There is a free space available right after the authors and commit date. Tags in separate list will be less useful. Tags can be created from the conext menu right here.
Reacted by Frank Etoundi, yhqjohn, Vladislav Osmanov, Marko Čančar, Christopher THAREAU and gregsadowy
I think it would be helpful to have it as an option in the commit panel, right below summary, and, more importantly, to be able to go to the History tab, right click a commit, and have two options: Add Tag and Remove Tag.
The actual tag should also show in the history log, perhaps in green next to or below the commit summary.
The push to remote should replicate the tag information including moves, deletes, and changes.
Reacted by Jeffrey D. King, yhqjohn and Momchil Borisov
I agree with @renegadedata, tags should be implemented in two contexts.
First, on the "Changes" tab, just above the Commit button, add some user input to add a commit tag and a pre-release checkbox that appears when the tag input is non-empty.
Second, on the "History" tab, tags would be added as badges next to the commit name. On this tab, if you right-click on a commit, there would be an option to "edit tag" if there was already a tag, or "add tag" if there was not. These would bring up appropriate modals to accomplish the tag edit/add tasks.
Thanks for the ideas, y'all. I'll add some of my thoughts to this from the backend side.
Displaying Tags
Why not in commit panel? There is a free space available right after the authors and commit date.
@crea7or@kingjeffrey I had a look at the docs to see if we can get this information from git log (which is the source of these commits). We use --pretty and these placeholders:
// author identity string, matching format of GIT_AUTHOR_IDENT.
// author name <author email> <author date>
// author date format dependent on --date arg, should be raw
'%an <%ae> %ad',
'%cn <%ce> %cd',
'%P',// parent SHAs,
'%(trailers:unfold,only)',
].join(`%x${delimiter}`)
%d or %D is the placeholder to add the refs associated with this commit, and each entry looks like this:
$ git log --decorate=short --pretty='%H %s %b %d' -n 2500 | grep 'tag:'
57fe4f59955c74359a40fbe3d1bf02ea77f3a69c Merge pull request #5130 from desktop/cut-a-new-beta time for a fresh beta (HEAD -> master, tag: release-1.3.0-beta1, shiftkey/master, origin/master, origin/HEAD, github-desktop-agisilaos/master)
61d9aea2c1f19af9e3f9f1fd4d17f3f2495f5e09 bump for next beta (tag: release-1.2.7-beta0)
908a2695640cbc6d00cad303d5c0c2d2eb864245 actually this is the right PR number (tag: release-1.2.6)
0a1e96794fb9c8e87e3b501b5fdb85e372f5ee90 bump beta channel too (tag: release-1.2.6-beta0)
02240059e44c1d856a930a51c7b6621bff327768 changelog for hotfix release (tag: release-1.2.5)
I think if we can figure how how to extract these from the log output:
We can then figure out whether the commit list makes sense or the commit detail form, like GitHub The Website does (we like to be consistent across products wherever this makes sense):
Managing Tags
I think it would be helpful to have it as an option in the commit panel, right below summary, and, more importantly, to be able to go to the History tab, right click a commit, and have two options: Add Tag and Remove Tag.
@renegadedata I haven't really thought much about adding and particularly removing tags in terms of the workflow, but I have some initial reservations around letting users delete tags which exist on a remote.
For reference, we prompt the user when they delete a local branch that is tracking a remote branch to confirm the action. But tags feel more permanent, so we should be cautious about this side of things.
The push to remote should replicate the tag information including moves, deletes, and changes.
I don't think we do any of this currently, and I think we could investigate the tradeoffs for adding --follow-tags to a git push so that we also push local tags that were created on the branch you are currently pushing - this seems like a responsible thing to do.
The code for that is in here - are you interested in submitting a fix for that so we can talk about this scenario further?
@crea7or we can't display things we don't have the data for, which i why i wrote up how to get that as a pre-requisite. But if someone wants to build upon that and get something working in the app then then sure, why not?
@shiftkey In the logs used to populate history, I see tag information. I assume "pre-release" status is not exposed in the logs. If so, I assume that information is not available to the history tab. Is this correct?
@kingjeffrey I'm not sure what "pre-release status" refers to here, but the snippet above shows how we can get these from the logs when using the pretty formatting:
$ git log --pretty='%H %s %b %d' -n 2500 | grep 'tag:'
57fe4f59955c74359a40fbe3d1bf02ea77f3a69c Merge pull request #5130 from desktop/cut-a-new-beta time for a fresh beta (HEAD -> master, tag: release-1.3.0-beta1, shiftkey/master, origin/master, origin/HEAD, github-desktop-agisilaos/master)
61d9aea2c1f19af9e3f9f1fd4d17f3f2495f5e09 bump for next beta (tag: release-1.2.7-beta0)
908a2695640cbc6d00cad303d5c0c2d2eb864245 actually this is the right PR number (tag: release-1.2.6)
0a1e96794fb9c8e87e3b501b5fdb85e372f5ee90 bump beta channel too (tag: release-1.2.6-beta0)
02240059e44c1d856a930a51c7b6621bff327768 changelog for hotfix release (tag: release-1.2.5)
Follow up question based on your responses. It seems like we can create annotated tags with just the tag name and everything else empty, which would allow us to treat them just like lightweight tags from the user's perspective, but retain flexibility for potentially offering more functionality down the road. This would also allow us to constrain the tags we push to only annotated tags so people aren't inadvertently pushing a bunch of old lightweight tags to GitHub.
For those of you who suggested lightweight tags, if we were to use annotated tags with just the tag name instead, would that cause any problems for you?
Reacted by Mike Trewartha, Sammy-T, Matthew Ibarra, Ricky Schools, François VEAUVY, Refringe, David Smekal and prios-karly-nelson
This is a very good news!
We can see tags on commits and add them, but is there way to delete a tag?
Do you plan to add an option to list all the tags of the repository, so we can find a commit from a tag?
Still cannot select existing tags like we can on github.com?
Reacted by cypress evelyn masso, Sammy-T, G. Angelucci, SS-Akash, Shallon Elizabeth Brown, Nguyen Cuong, Tomasz Sawicki, Marlon Rodriguez, s0ftcorn and Andrin Schaller
This is tangential somewhat, but related to tags, and since GitHub+NPM is a thing now, figured I'd mention it in case any other package maintainers have run into this:
I would love a "Tag & publish" button, for NPM packages -- i.e. a GUI equivalent to npm version && git push && git push --tags && npm publish
e.g. a dropdown with options equivalent to:
npm version patch
npm version minor
npm version major
npm version
To recap: npm version does (1) update package.json, (2) commit, (3) tag
(P.S. at some point, support for NPM dist tags would be a nice bonus, e.g. for doing edge-tagged prerelease distributions)
Activity
crea7or commentedon Jun 14, 2018
@shiftkey is there any backend to fetch/store tags in desktop code? I really like to see the tags too and I'm deciding how hard it for me to implement it.
shiftkey commentedon Jun 15, 2018
@crea7or before diving into the code I'd recommend starting from proposing how the user would interact with tags in the app, to illustrate the potential workflows and help size up the work.
An example of this is a mockup in an earlier thread about this: #257 (comment)
Going beyond "Git has feature XYZ" and walking through how a feature would look or feel in Desktop is where I'd recommend starting with this - this will help get others behind a potential solution to the problem at hand.
crea7or commentedon Jun 15, 2018
Why not in commit panel? There is a free space available right after the authors and commit date. Tags in separate list will be less useful. Tags can be created from the conext menu right here.

renegadedata commentedon Jun 15, 2018
jeffreydking commentedon Jul 10, 2018
I agree with @renegadedata, tags should be implemented in two contexts.
First, on the "Changes" tab, just above the Commit button, add some user input to add a commit tag and a pre-release checkbox that appears when the tag input is non-empty.
Second, on the "History" tab, tags would be added as badges next to the commit name. On this tab, if you right-click on a commit, there would be an option to "edit tag" if there was already a tag, or "add tag" if there was not. These would bring up appropriate modals to accomplish the tag edit/add tasks.
j-f1 commentedon Jul 10, 2018
Perhaps we could have a “🏷➕” button, next to the “Add Co-Authors” button.
shiftkey commentedon Jul 12, 2018
Thanks for the ideas, y'all. I'll add some of my thoughts to this from the backend side.
Displaying Tags
@crea7or @kingjeffrey I had a look at the docs to see if we can get this information from
git log(which is the source of these commits). We use--prettyand these placeholders:desktop/app/src/lib/git/log.ts
Lines 58 to 69 in 57fe4f5
%dor%Dis the placeholder to add the refs associated with this commit, and each entry looks like this:I think if we can figure how how to extract these from the log output:
desktop/app/src/lib/git/log.ts
Lines 104 to 111 in 57fe4f5
And attach these to the
Commitmodel:desktop/app/src/models/commit.ts
Line 27 in 57fe4f5
We can then figure out whether the commit list makes sense or the commit detail form, like GitHub The Website does (we like to be consistent across products wherever this makes sense):
Managing Tags
@renegadedata I haven't really thought much about adding and particularly removing tags in terms of the workflow, but I have some initial reservations around letting users delete tags which exist on a remote.
For reference, we prompt the user when they delete a local branch that is tracking a remote branch to confirm the action. But tags feel more permanent, so we should be cautious about this side of things.
I don't think we do any of this currently, and I think we could investigate the tradeoffs for adding
--follow-tagsto agit pushso that we also push local tags that were created on the branch you are currently pushing - this seems like a responsible thing to do.The code for that is in here - are you interested in submitting a fix for that so we can talk about this scenario further?
desktop/app/src/lib/git/push.ts
Lines 38 to 45 in 57fe4f5
shiftkey commentedon Jul 12, 2018
I'm moving this to a
user-researchtask because there's lots of ideas around the interactions that we need to think about some more.crea7or commentedon Jul 12, 2018
Can we start with displaying tags in history?
shiftkey commentedon Jul 12, 2018
@crea7or we can't display things we don't have the data for, which i why i wrote up how to get that as a pre-requisite. But if someone wants to build upon that and get something working in the app then then sure, why not?
jeffreydking commentedon Jul 12, 2018
@shiftkey In the logs used to populate history, I see tag information. I assume "pre-release" status is not exposed in the logs. If so, I assume that information is not available to the history tab. Is this correct?
shiftkey commentedon Jul 12, 2018
@kingjeffrey I'm not sure what "pre-release status" refers to here, but the snippet above shows how we can get these from the logs when using the pretty formatting:
51 remaining items
slspencer commentedon Apr 1, 2020
Start with lightweight tags! There will always be users who urge you to 'do it all', but it's ALWAYS best to implement the minimum feature set first.
billygriffin commentedon Apr 1, 2020
Follow up question based on your responses. It seems like we can create annotated tags with just the tag name and everything else empty, which would allow us to treat them just like lightweight tags from the user's perspective, but retain flexibility for potentially offering more functionality down the road. This would also allow us to constrain the tags we push to only annotated tags so people aren't inadvertently pushing a bunch of old lightweight tags to GitHub.
For those of you who suggested lightweight tags, if we were to use annotated tags with just the tag name instead, would that cause any problems for you?
slspencer commentedon Apr 1, 2020
+1 Annotated tags with just the tag name
billygriffin commentedon May 7, 2020
Hi folks, this is all now live on beta so I'm going to close this issue. 🎉 We expect the production release to happen next week! If you want to start using it immediately, you can download the beta here: https://github.com/desktop/desktop/#beta-channel
Thank you all SO much for all the input along the way - it has been immensely helpful. ❤️ ✨
billygriffin commentedon May 12, 2020
This is now released to production! https://github.blog/2020-05-12-create-and-push-tags-in-the-latest-github-desktop-2-5-release/
sraillard commentedon May 12, 2020
This is a very good news!
We can see tags on commits and add them, but is there way to delete a tag?
Do you plan to add an option to list all the tags of the repository, so we can find a commit from a tag?
adipose commentedon Jun 8, 2020
Still cannot select existing tags like we can on github.com?
mikermcneil commentedon Nov 19, 2020
This is tangential somewhat, but related to tags, and since GitHub+NPM is a thing now, figured I'd mention it in case any other package maintainers have run into this:
I would love a "Tag & publish" button, for NPM packages -- i.e. a GUI equivalent to
npm version && git push && git push --tags && npm publishe.g. a dropdown with options equivalent to:
To recap: npm version does (1) update package.json, (2) commit, (3) tag
(P.S. at some point, support for NPM dist tags would be a nice bonus, e.g. for doing edge-tagged prerelease distributions)
MiguelRipoll23 commentedon May 23, 2021
@mikermcneil found something for that, check this out.
9503261188 commentedon May 23, 2021
9503261188 commentedon May 23, 2021
Naminave commentedon Mar 25, 2022
so many comments and none gives a solution to what was proposed by OP, to be able to change between tags?
OverLordGoldDragon commentedon Aug 5, 2023
@ImanCol Another meaning of "tags" is invoked in OP. I agree the one you mention is useful, and opened #17185.
Add remote and tag managers and an SSH key helper