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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s