On Github lunika / git-slides
http://uploads.siteduzero.com/files/236001_237000/236932.png
$ git config --global user.name "Manuel Raynaud"
$ git config --global user.email "raynaud.manu@gmail.com"
$ git config --global alias.ci "commit"
$ git config --global alias.co "checkout"
$ git config --global alias.st "status"
$ git config --global core.editor "vim"
[user]
name = Manuel Raynaud
email = raynaud.manu@gmail.com
[color]
diff = auto
status = auto
branch = auto
[alias]
ci = commit
co = checkout
st = status
br = branch
merge = me
[core]
editor = vim
[push]
default = simple
Création d'un projet inexistant
$ mkdir myProject
$ cd myProject
$ git init
Création d'un projet existant
$ git clone https://github.com/thelia/thelia.git thelia
$ cd thelia
git supporte plusieurs protocoles : http(s), ssh, git
Le commit intervient le plus tôt possible
Création d'un nouveau fichier et intégration au dépôt
$ touch Readme.md //untracked
$ git add Readme.md //staged
$ git commit -m "create readme file" //commited
Modification d'un fichier et commit
$ echo "Hello World!" > Readme.md //unstaged
$ git add Readme.md //staged
$ git commit -m "implement readme file" //commited
$ echo "Hello World!" > Readme.md //unstaged
$ git commit -am "implement readme file" //commit all
le tag parfait ?
Un tag est un label sur un commit
un numéro de commit ressemble à ça : fbc3b740b1a3b50cb8d2f15a2abd2126f6ea173a
Création d'une branche
$ git branch ma_branche
Visualiser toutes ses branches locales
$ git branch
caching
content
frontend
http_caching
* master
refactor_action
Passer d'une branche à une autre
$ git checkout ma_branche
Attention, checkout ne sert pas qu'à changer de branche.
merge d'une branche dans une autre
$ git checkout master
$ git merge ma-branche
Et tu pull pull pull ce code qui te plaît Et tu push push push c'est ta façon d'partager
$ git branch --track {branche-locale} origin/{branche-distante}
$ git pull
$ git push origin {branche-distante}
Avec la même commande on crée une branche distante si elle n'existe pas encore
http://git-scm.com/ Gérez vos sources avec git Pour arrêter de galérer avec git