How To Setup A Git Repository

Every new project should be connected to a remote git repository for a number of reasons including protection from loss and version control.

Create project folder on local computer from command line

$ cd ~/Projects
$ mkdir nameit
$ cd nameit

Make git

$ git init

Create repo on Github

Click new repo

Get address of Git

Get SSH address (with colon after

Create remote

$ git remote add origin

In summary…

echo "some text" >>
git init
git add
git commit -m "first commit"
git remote add origin
git push -u origin master

Copyright 2021. All Rights Reserved. Adam Patel