Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does cloning a GitHub repository mean?

Tags:

I am trying to integrate Facebook with my app. I read this on developers.facebook.com:

  1. Install XCode
  2. Install Git
  3. Clone the GitHub repository with this command:
    git clone git://github.com/facebook/facebook-ios-sdk.git

I have installed XCode and Git.

What does it mean to clone a GitHub repository and how can I do that?

like image 761
Piscean Avatar asked Feb 28 '11 14:02

Piscean


People also ask

What is the purpose of cloning in GitHub?

Usage. 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.

What is meant by cloning repository?

Cloning a repository means that you're downloading a copy of the source code from source control. To use the iOS SDK you have to download the code from GitHub (ie- clone the iOS SDK repository).

Is it safe to clone git repository?

It is safe, however, to run git gc , which uses the --local option by default. If you want to break the dependency of a repository cloned with --shared on its source repository, you can simply run git repack -a to copy all objects from the source repository into a pack in the cloned repository.

What is the difference between cloning and downloading from GitHub?

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.


2 Answers

To clone a repository means to duplicate and download everything in the repository.

You are on a Mac, so launch Terminal, create a folder and type this command:

git clone git://github.com/facebook/facebook-ios-sdk.git 

It will duplicate and download the entire repository.

like image 156
PierreL Avatar answered Oct 12 '22 08:10

PierreL


Cloning a git repository means that you create a local copy of the code provided by developer. You can simply do it with a command line:

git clone git://github.com/facebook/facebook-ios-sdk.git . 

and you'll have the code in the facebook-ios-sdk directory.

like image 45
Stéphane Péchard Avatar answered Oct 12 '22 08:10

Stéphane Péchard