Skip to content

Describe how to fetch tags in contribution guide #147

@HalfWhitt

Description

@HalfWhitt

What is the problem or limitation you are having?

For the longest time, it was driving me nuts that I couldn't view or checkout any tags on my local repo clones. If I wanted to browse or test a BeeWare library at a specific version, I had to go to GitHub, look up that release, and copy its commit hash in order to check that out.

I finally figured it out back in the summer: beeware/toga#3683 (comment)

When you fork a repo on GitHub, your fork copies all the commit history, but not the tags. As far as I know, there's no way to tell it to do so. What I had to do was:

  1. Add the upstream repo (the "real" BeeWare one, from which I forked mine) as a remote on my local repo, e.g.:
    git remote add upstream https://github.com/beeware/toga.git
    
    ("upstream" is conventional, but you can name it whatever you like.)
  2. Fetch the tags from the original, rather than my fork:
    git fetch --tags upstream
    
    (Or whatever you named it)
  3. For good measure, if you'd like, you can also push them to your own fork:
    git push --tags
    
    They're already on your local repo from (2), but this can be handy if, say, you want to make a fresh clone later; now you'll be able to pull the tags from your own fork without even having to add the upstream remote.

Describe the solution you'd like

Considering how long this baffled me, I'd love it if this were in the contribution guide.

I'm not positive where to put it, since it's not exactly something one needs in order to get started, especially not at first. But it would be great if it's discoverable.

Describe alternatives you've considered

It's not a huge deal to not have this... just potentially inconvenient and confusing.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions