Setup git Repo

Some useful reference steps for setting up your git repo. Works on both Linux and Windows command line, just note that the “touch README.md” won’t work on windows, just create a new txt file instead.

Setup your name and email

git config --global user.name "name"
git config --global user.email "blah@example.com"

Create a new repository

mkdir my-project
cd my-project
git init
touch README.md
git add README.md
git commit -m "first commit"
git remote add origin git@example.com:example/my-project.git
git push -u origin master

Push an existing Git repository

cd existing_git_repo
git remote add origin git@example.com:example/my-project.git
git push -u origin master

Leave a Reply

Your e-mail address will not be published. Required fields are marked *