1

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

3 Answers3

1

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

aldarisbm
  • 417
  • 3
  • 8
1

New repository

git ls-remote.

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.

Iuri Guilherme
  • 389
  • 1
  • 10
  • 1
    thanks 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
0

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
Dharman
  • 30,962
  • 25
  • 85
  • 135