Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you use the Ubuntu command line to pull a project that's been uploaded onto Git?

I (think) I've set up Git correctly. How do I pull my friend's project that he's shared with me so that I can help him with it?

like image 708
Kaitlyn Mcmordie Avatar asked Apr 02 '12 01:04

Kaitlyn Mcmordie


People also ask

How do I pull a project from a git repository?

On GitHub.com, navigate to the main page of the repository. Above the list of files, click Code. Click Open with GitHub Desktop to clone and open the repository with GitHub Desktop. Follow the prompts in GitHub Desktop to complete the clone.

How do I pull a project from GitHub Linux?

To do so, simply open a terminal window in the directory with the local version of the repository and type the command “git pull”. The operation of this command is particularly simple if you're just wanting to download an updated version of the repository; the local version will be updated to match the remote version.


2 Answers

By "uploaded onto Git" I assume you mean "uploaded onto GitHub". That's an important distinction: Git is a source control system. GitHub is a place to host repositories that are controlled via git.

To clone a repository that is hosted on GitHub, first log into your github account and go to the main page (https://github.com/). Off to the right, just under the tiles at the top will be a section labeled "Your Repositories". The one your friend shared with you should be listed. Click on it. Then near the top of this new page, you'll see a git clone url like "[email protected]:abc/xyz.git". Copy this and then run the command:

git clone [email protected]:abc/xyz.git
like image 59
Ben Lee Avatar answered Oct 21 '22 21:10

Ben Lee


Assuming you're trying to clone a repository from GitHub, you will need to follow these steps:

  1. Get the HTTPS URL of the repo as shown in this screenshot
  2. On a terminal window type the command (be sure to enter the URL you copied in step 1):

    git clone HTTPS_URL_COPIED_IN_STEP_1.git

  3. If you are asked for your GitHub username & password enter them now. Please note that the username is not your email address.

If you have 2-factor authentication turned on, you'll need to create a personal access token first.Your regular password will not work if you use 2-factor authentication on GitHub.

Follow the instructions here to create the token. Once this is done, enter this in place of the password after step 2.

like image 23
Joe Avatar answered Oct 21 '22 19:10

Joe