Git Notes – Basics

Initial commit

mkdir my_project
cd my_project
touch .gitignore
git init
git add .
git commit -m "Initial commit"
git remote add origin youruser@yourserver.com:/path/to/my_project.git
git push origin master

———————————————————————
Clone to local repo

git clone git@github.com:whatever folder-name
git add .
git commit -m "Initial commit"
git push origin master

Clone a specific Git branch

git clone -b my-branch git@github.com:user/myproject.git
Advertisements