I have started using GitHub recently. I would like to know the difference between cloning and downloading a GitHub repository. Does they both lead to making a copy of the repository?
Asked
Active
Viewed 4.4k times
26
-
Is there something specific that makes you think they are different? – loganfsmyth Aug 12 '15 at 23:56
2 Answers
36
When you download the repo it just gives you all the source files with no .git so you dont have the repo. When you clone you get a copy of the history and it is a functional git repo.

Michael Rice
- 7,974
- 1
- 15
- 18
-
-
You can clone using git clone, no reason to curl if you have git locally installed. – Henry Prickett-Morgan Apr 10 '19 at 21:34
21
Downloading a repository just downloads the files from the most recent commit of the default branch. It doesn't download any of the files in the .git folder.
If this sounds like gibberish, all it does is download the most recent copy of the code. It doesn't download any of the history, so you can't browse through the history. You can't view any of the commit messages. You can't run git commands like git add
, git push
, etc. It's as if git never existed, and all you have is a copy of the code/files.

Kevin Wheeler
- 1,331
- 2
- 15
- 24
-
One of the things I've wondered is if you clone the repository, and you commit, are you modifying the files on server as well as locally? – Phil Oct 02 '17 at 06:54
-
2@Phil commits are done locally. If you want to update GitHub with commits, that is when you perform a `git push`. – Retro Gamer Oct 04 '17 at 16:58