Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git clone vs copy paste, what's the difference?

as stated in the subject

note: the git clone i mean is the git clone without any option, the one which is performed by doing "git clone /C:/my_origin_folder"

like image 475
fajrian Avatar asked Sep 05 '11 03:09

fajrian


People also ask

What is the difference between git clone and copy?

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.

What is the difference between git clone and download?

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.

What does git clone actually do?

git clone is primarily used to point to an existing repo and make a clone or copy of that repo at in a new directory, at another location. The original repository can be located on the local filesystem or on remote machine accessible supported protocols. The git clone command copies an existing Git repository.

Can you copy paste a git repo?

Technically speaking, git can operate just fine with copied repositories running around everywhere, because the whole point of a DCVS is that it doesn't have to know what's going on outside of any given repository, and in fact doesn't unless you tell it.


1 Answers

This answer of mine regarding backup should give you some answer on clone vs copy: Moving a git repo to a second computer?

Main differences:

  1. When you clone, you get remote origin setup pointing to original repo, so that you can push to it.
  2. You don't get hooks and reflog ( and also old objects) and other remotes when you clone but you do when you copy

Note that when you clone with a folder path, the differences change subtly, as the objects and refs are usually just copied / hardlinked ( equivalent of --local which is the default with local folder paths)

like image 181
manojlds Avatar answered Oct 04 '22 02:10

manojlds