by using git clone https://github.com/gpac/gpac gpac_public
I get the 1.0.0 version, rev 156, I need to go back to 0.8.0 version.
I m newer git user, please may ask how to display all the available version for download/git clone, and the clean way to switch the selected previous version with the current one?
Thank you!
Gian

- 249
- 5
- 16
-
This question is not really related to the tag **ubuntu**, but rather to **git**. – Iuri Guilherme Jul 27 '20 at 03:07
3 Answers
This has probably been answered before, but to list all of the tags you can do:
git tag
to checkout a specific tag you can do:
git checkout tags/<tag> -b <branch>
To fetch all of your tags for your repo you can do:
git fetch --all --tags

- 417
- 3
- 8
-
git tag give me: fatal: Not a git repository (or any of the parent directories): .git – Massimo Vantaggio Jul 27 '20 at 02:42
-
1This is probably because you havent cd'd into the directory where you cloned your git repo – aldarisbm Jul 27 '20 at 02:44
New repository
If you use git ls-remote --tags https://github.com/gpac/gpac
you'll see all release tags.
Since the one you want is v0.8.0 and it is present in the aforementioned list, you may clone the repository in that specific release with the following clone command:
git clone --branch v0.8.0 https://github.com/gpac/gpac gpac_public
See also this question and this question.
Already existing repository
If you have already cloned the repository at HEAD (which is what happenend when you used git clone https://github.com/gpac/gpac gpac_public
), then you may revert history to the tag you want this way:
First make sure you are inside the repository folder:
iuri@ubuntu:~$ cd gpac_public
Then checkout in the tag you want:
iuri@ubuntu:~/gpac_public$ git checkout v0.8.0
This will make the repository looks as if you have cloned straight from the v0.8.0 tag.

- 389
- 1
- 10
-
1thanks luri Guilherme, very clear!, there s also a way to replace it? or may ask which is the right way to delete the version the I want override? – Massimo Vantaggio Jul 27 '20 at 02:41
-
I included instructions if you want to use the repository you have already cloned, it's same as [@Jose B. answer](https://stackoverflow.com/a/63107902/7839535). – Iuri Guilherme Jul 27 '20 at 02:43
You may need to revert the commits going back to 0.8.0 tag. If you'll look at the repo's tag, and select your preferred version, it will display there the commit when it was tagged.
# fetch the commit
git fetch origin <commit_id>
# reset the repo to that commit
git reset --hard FETCH_HEAD

- 30,962
- 25
- 85
- 135

- 16
- 3