Software Development

How To Setup A Git Repository

Posted by Adam

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 github.com)

Create remote

$ git remote add origin git@github.com:makersacademy/gitname.git

In summary…

echo "some text" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin git@github.com:makersacademy/gitname.git
git push -u origin master

Leave A Comment