difference between git remote and git clone

0 votes

What is the difference between git remote and git clone?

May 11, 2018 in Git & GitHub by GandalfDwhite
• 1,320 points
3,318 views
I didn't understand the git remote
In simple terms, git remote does not give you the actual repository, you only have the reference to the original repo.

3 answers to this question.

0 votes

They are two completely different things.

git remote is used to refer to a remote repository or your central repository.

For e.g: When you want to add a remote repository as your origin, you use this command:

image

git clone is used to copy or clone a different repository.

image

To learn more about the git commands, read this blog:

Git Tutorial | Commands And Operations In Git | Edureka

answered May 11, 2018 by DragonLord999
• 8,420 points
0 votes

git remote add just creates an entry in your git config that specifies a name for a particular URL. You must have an existing git repo to use this.

git clone creates a new git repository by copying an existing one located at the URI you specify.

Try this out:

# git clone REMOTEURL foo

and:

 # mkdir foo
 # cd foo
 # git init
 # git remote add origin REMOTEURL
 # git pull origin master

Now there are minor differences, but fundamentally you probably won't notice them. As an exercise left to the reader, compare the .git/config's from each directory.

answered Aug 7, 2018 by Kalgi
• 51,890 points
0 votes

HI....

GIT REMOTE add just creates an entry in your git configuring  that specifies a name for a particular URL. You must have an existing git report  to use this.

GIT CLONE creates a new git repository by copying an existing one located at the URL you specify.

The differences between git clone and git remote:

git clone:

Will physically download the files into your computer. It will take space from your computer. If the repo is 200Mb, then it will download that all and place it in the directory you cloned.

git remote add:

Won't take space! It's more like a pointer! It doesn't increase your disk consumption. It just gets a snapshot of what branches are available and their git commit history I believe. It doesn't contain the actual file/folders of your project.

If you do:

git remote add TechLeadRepo  git://github.com/user/test.git

then you haven't added anything to your computer. After you've added it in your remote branches then you're able to get a list of all branches on that remote by doing:

git fetch --all

upon fetching (or pulling), you download the files And then if you wanted to do get your colleague's feature22 branch into your local, you'd just do

git checkout -b myLocalFeature22 TechLeadRepo/feature22

Had you cloned his repo then you would have to go into that local repository's directory and simply just checkout to your desired branch

i  hope this information may help you

answered Jul 10 by anonymous

Related Questions In Git & GitHub

0 votes
1 answer

difference between git fetch and git pull

Both fetch and pull are used to ...READ MORE

answered Jun 27, 2018 in Git & GitHub by anonymous
3,506 views
0 votes
2 answers

What's the difference between git push and git commit?

I installed ubuntu on vagrant and gave ...READ MORE

answered Jan 2, 2019 in Git & GitHub by Ali
• 10,670 points
409 views
0 votes
0 answers

Difference between git rebase and git merge? Which among them is better to use?

Difference between git rebase and git merge? ...READ MORE

Nov 25, 2019 in Git & GitHub by anonymous
• 11,850 points

closed Nov 25, 2019 by Sirajul 162 views
0 votes
2 answers

What is the difference between git fetch and git pull?

Hii.. I HOPE BELOW ANSWER  MAY HELP YOU- In ...READ MORE

answered Jul 17 in Git & GitHub by anonymous
365 views
+13 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,420 points
604 views
0 votes
1 answer
0 votes
1 answer

Configure Git and GitHub

In version control with Git, we deal ...READ MORE

answered Apr 26, 2018 in Git & GitHub by DragonLord999
• 8,420 points
72 views
0 votes
1 answer

Git origin not found

For this to work, you need to ...READ MORE

answered Apr 25, 2018 in Git & GitHub by DragonLord999
• 8,420 points
370 views