Clone remote git repository to commit


I have a project stored in a repository of

asked by mihael 27.07.2017 в 17:29

2 answers


Keep in mind

We must bear in mind that when doing a cloning of a repository remote from , download the entire repository , which may not necessarily limit the return to some commit in specific. p>

How do we do it?

I will explain an example with a repository that I created in

answered by 28.07.2017 / 03:14

You could do the following:

1.- Clone the repository from the desired branch

git clone https://<usuario><repositorio> id_commit

2.- Recover the specific commit

git fetch origin <sha1-del-commit> 

3.- Reset the branch to the desired commit

git reset --hard FETCH_HEAD
answered by 28.07.2017 в 03:10