Just take a commit from a github project?

Asked

Viewed 1,319 times

5

I’m following a step-by-step project of a course, there they make a video lesson and at the end of it they commit to the github with the content made of that project in that class... In order to do it together and not simply clone the entire repository with the ready project I launch my commits together on my github of each class in the same way that they.

But I arrived at the end of a certain class that didn’t work, my code was the same as the teacher’s but made an exception and I’m trying to find where I did wrong and I didn’t find... I wanted to know if there’s any way I can just clone the commit from that class the teacher did, so that I can move on from that point on without getting the whole project done.

2 answers

2


I’ll give you a tip without using the command line :)

Follow these steps:

Go to the repository root and click on the Commits list

inserir a descrição da imagem aqui


Now see the date and Commit from where you want to follow and click this button

inserir a descrição da imagem aqui


Now just click on the btn "Clone or Download" that you will download from that version.

inserir a descrição da imagem aqui


OBS: This download will download the complete project until this Commit, nothing that was commissioned after this date will be downloaded. So you can start from that point.

1

Check out only from commit_sha

Git repositories have this pattern https://github.com/<repo_name>/tree/<commit_sha>

Try to use these commands should work

git clone -n <repo_name>

git checkout <commit_sha>

  • if I give git checkout + commit id appears fatal: Reference is not a Tree

  • And git clone would clone the entire repository, no ?

  • Yes clones the entire repository from that commit

Browser other questions tagged

You are not signed in. Login or sign up in order to post.