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?
My understanding of the difference between cloning and downloading a project on Github is that by doing a clone you have git instantly enabled on that project, and a connection with the remote repository where you cloned it from, and so you get access to the history and commit messages and so on.
You can only clone into a local directory that is a properly initialized Git repository (using the git init command). Downloading a repository archive only copies a repository's source files from a specific point in time, depending on what was chosen to be copied.
"clone" uses git software on your computer to download the source code and it's entire version history. "download zip" creates a zip file of just the current version of the source code for you to download - the project history is not included.
Cloning a repository gives you a copy of that repository and configures the original repository as a remote. Copying a repository just gives you a copy of that repository. (Though you can of course just add the remote definition afterwards via git remote add .)
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With