Commandes git de base

create & clone

create new repository

git init

clone local repository

git clone /path/to/repository

clone remote repository

git clone usemame@host:/path/to/repository


add & remove

add changes to INDEX

git add

add all changes to INDEX

git add *

remove/delete

git rm


commit & synchronize

commit changes

git commit -m "Commit message"

push changes to remote repository

git push origin master

connect local repository to remote repository

git remote add origin

update local repository with remote changes

git pull


branches

create new branch

git checkout -b (e.g. git checkout -b featurex)

switch to master branch

git checkout master

delete branch

git branch -d

push branch to remote repository

git push origin


merge

merge changes from another branch

git merge io

view changes between two branches

git diff (e.g. git diff featurex featurey)


tagging

create tag

git tag (e.g. git tag 1.0.0 1b2e1d63ff)

get commit IDs

git log


restore

replace working copy with latest from HEAD

git checkout -- < filename >