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?
3 Solutions collect form web for “How do you use the Ubuntu command line to pull a project that's been uploaded onto Git?”
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@example.com:abc/xyz.git”. Copy this and then run the command:
git clone firstname.lastname@example.org:abc/xyz.git
Assuming you’re trying to clone a repository from GitHub, you will need to follow these steps:
- Get the HTTPS URL of the repo as shown in this screenshot
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
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.
git pull origin <branch>