0

My question is how to get the version of code of a specific commit in my pc. For exemple if I have this commit 86b403574c90f16b77da4bef8d67a71471ad7f77 I need the version of code of this commit on a folder it's like coloning all the project

I tried:

git checkout 86b403574c90f16b77da4bef8d67a71471ad7f77

but it returns the modified files on the console.

1 Answers1

0

Git checkout it supposed to change what you're looking at. Have you tried doing a fresh clone of the remote master repository? At that point you should be able to navigate to the repo folder and run git checkout <commit_number> to swap the code over to the commit of your choice.

  • this what I tried it returns just the modified file not a folder on my pc – Oumayma Hamdi Jun 05 '19 at 14:56
  • The folder should already exist from your initial clone. Checkout will change the code in that same folder. Have you double checked the commit tree to be sure you're checking out the right version? – Thanos T. M. Jun 05 '19 at 15:00
  • OK you mean that the changes are in the same folder but just one thing how can I check the commit tree sorry for this question but I'm not familiar with git and github – Oumayma Hamdi Jun 05 '19 at 15:05
  • No worries. Navigate to the repo folder and run ``git log``. Then you can see a list of previous commits – Thanos T. M. Jun 05 '19 at 15:50