10

I am about to make a major technology change to my project, moving from ANT to Gradle. There has never been a release of this project -- it is still in development. I would like to tag the last old technology version so that it can be found for reference or reversion. But I don't want to imply that there is any kind of release.

[AN ADDED THOUGHT: I would expect some interested person to see a release and think that it might be a usable "release". That is, I'm thinking releases are for users and tags are for developers. ]

I would prefer an answer that does not require me to drop into the Git command line, but if that's necessary, please assume that I have forgotten what little I ever did attempt to learn.

In a comment on an answer to the question create-a-tag-in-a-github-repository, @RandomDSdevel says:

[S]houldn't you be able to create tags that don't automatically get picked up by GitHub as releases…?

Then

I submitted a support request to GitHub about this a while ago, but they had a bit of a support backlog back then, so my request was closed.

2
  • Doing your work in a branch seems more appropriate, that's what they're for.
    – Schwern
    Commented Oct 30, 2020 at 2:38
  • @Schwern, I wish I had just done it in a branch. I think I will make it a branch now that I think about it; I'll just dump all my work so far into the branch, which will get me back into my regular flow for double checking everything then merging. But that still leaves the question of tagging the pre-merge master version just in case I want to refer to it later.
    – cowang
    Commented Nov 2, 2020 at 15:32

3 Answers 3

6

The easiest solution would be to create a release (in the GitHub UI), and then delete the release.
This will only delete the release, but the tag will remain still, which would be the solution to your problem.

Hope this is useful to you. 🙂

3
  • And the tag name still has to start with a silly "v0.0" trying to make sense as a release.
    – cowang
    Commented Nov 2, 2020 at 15:41
  • @cowang You can delete the tag, create another one with the name you want, and then delete the release but not the tag. Commented Nov 2, 2020 at 18:01
  • The details of how to delete a release are here.
    – cowang
    Commented Nov 5, 2020 at 17:16
4

Summarizing my experience so far using GitHub to create a tag without a release:

I can create a release, but it requires my tag name to have a version at the start, like

v0.0-MyTagName

If I delete the release, the tag still shows up under the list of tags (and the list of releases, but at least it doesn't show up in the headline type that it did as a release).

At this point I can edit the tag name to get rid of the "v0.0-", leaving the name that I really want. It looks like it switches you to editing a release, but it stays as a tag unless you add a title. Now it doesn't look like a release, even though the tag name shows up in the list of releases.

Using git instead of GitHub, you may be able to do more.

I could not find the tags or releases in GitHub Desktop. If you just want to look at the code at a branch, you will have to do that online. If you want to modify the code at the tag, you need to create a branch, of course. Branches are visible in GitHub Desktop.

1

I wish I had just done it in a branch.

It's not too late, and without losing any history.

Make a branch off master now, that will have your Ant -> Gradle work.

git branch ant_to_gradle master

Move master back to the last stable commit.

git checkout master
git reset --hard <last stable commit>

Gently force push the reset master branch.

git push --force-with-lease

Continue to work on ant_to_gradle and leave master alone.

Yes, that involves dropping into the command line. There are Git apps which will do this for you, I like GitUp, but my advice is to get comfortable with the command line. Apps are useful, but limiting.

But that still leaves the question of tagging the pre-merge master version just in case I want to refer to it later.

You could tag it locally and not push the tag.

You could tag it and trust that if someone sees a release called pre-gradle they know what they're getting into. You can also edit a release to mark it a pre-release.

But my advice is to not litter your repo with "just in case I need it" tags and instead make searchable commits and get comfortable searching history; because you won't always think to make a tag. If you merge your work in a Pull Request, Github will produce a consistent merge commit message like Merge pull request #1859 from ant_to_gradle. Then you can search for that to find the merge commit and look backwards.

4
  • re "my advice is to get comfortable with the command line". I only run into a GitHub issue every year or two. My experience is that I forget the command-line. I once was very good at both the Tandem system command line and MS Dos, and decent at Unix, But now I use too many different programs to keep track of their command line details. My only hope is to come to StackOverflow when I run into trouble.
    – cowang
    Commented Nov 5, 2020 at 17:05
  • Thanks for the details about how to back out if I had already committed to the Master. That will be very helpful to some people. Luckily, I still have the new version separate in a private repository.
    – cowang
    Commented Nov 5, 2020 at 17:08
  • And thanks for the link. I saw at deleting a release the detail that I was missing.
    – cowang
    Commented Nov 5, 2020 at 17:14
  • I finally found the list of commits in GitHub. Click the link at the top right of the file list on the repository home page. The list of pull requests may be more useful; they are available from the tabs at the top of the page.
    – cowang
    Commented Nov 6, 2020 at 22:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.