Git Cheat Sheet

Create a git project with a remote repository remote:/repository# mkdir project.gitremote:/repository# cd project.gitremote:/repository# git init –bare local:/project# git initlocal:/project# git add .local:/project# git commit -m “Initial commit.”local:/project# git remote add origin username@remote:/repository/project.gitlocal:/project# git push origin master

Create a git project with a remote repository

remote:/repository# mkdir project.git
remote:/repository# cd project.git
remote:/repository# git init --bare
local:/project# git init
local:/project# git add .
local:/project# git commit -m "Initial commit."
local:/project# git remote add origin username@remote:/repository/project.git
local:/project# git push origin master