Git Basics from the Command Line

Using Git from the Command Line

notebook sketch of github logo

Install Git

In order to use the git command we’ll need to install git first.

sudo apt-get install git

Create a project folder

Now that git is installed, let’s create a project folder where our repository will be located.

sudo mkdir yourNewFolder

Navigate to the folder you just created.

cd yourNewFolder
git init

Pull the repository down

Let’s grab the desired repository and save the code locally.

git pull http://yourDesiredRepositoryURL

Write your code

Make your changes/fixes and save.

Add the modified files to the commit

git add theFileYouModified.js

Commit your changes

git commit -m "this is your commit message"

Update the repository

Now that you have written and committed your code, it’s time to push it to the repository.

git push http://yourDesiredRepositoryURL