Git – Setting up new repositories

Setting up a new repository – locally

Here is the standard way to start a new repository from an existing directory. The first part just tells creates some content. You really just need to start from the “git init” line and add all the files you want with “git add”.

mkdir api-test
cd api-test
git init
touch README
git add README
git commit -m ‘first commit’


Pushing to a duke math gitlab repository

Assuming  I have already set up a get lab repository called api-test the following command pushes the git repository I set up above to that repository. Of course you would replace “jonm” with your username. gitlab actually tells you what to so.

git remote add origin
git push -u origin master

Leave a Reply

Your email address will not be published. Required fields are marked *