I need to clone a private repository from GitHub, but I only want to get a specific tag (so basically, cloning is actually the wrong term for it).
Now, the problem is that there are multiple options, and all of them don't really work out:
- GitHub offers tagged versions as archives, but they are not accessible via
curl
orwget
(at least I could not figure out how). - GitHub does not support archiving repositories.
- I could run a
git clone
and then run agit checkout
to get to the version specified by the tag, but then I download more than I need, I am in detached head state, and all the remaining stuff stays on disk. Of course, I could clean this up manually, but … well, lots of work for a trivial task.
What is the best way to achieve what I want to do?
Update
I think my question was not clear enough, hence I'm adding some more information: What I want is not only get to the revision marked by a tag, but I also want to remove the entire history. Basically, as if Git never existed, and all I ever had was this one single version of my code. Any hints?