Git basic notions
How to create temporary repositories and files to train :
- cd /tmp
- mkdir git_essais
- cd git_essais
- mkdir remote_dir
- mkdir locale_dir
- cd remote_dir
- git init --bare biblio1.git
- git init --bare prod1.git
- cd ../locale_dir
- git clone file:///tmp/git_essais/remote_dir/prod1.git
- git clone file:///tmp/git_essais/remote_dir/biblio1.git
- cd prod1
- echo "$PWD:line1" >>prod1_1.txt
- echo "$PWD:line1" >>prod1_2.txt
- git add prod1_1.txt
- echo "$PWD:line1" >>prod1_3.txt
- git commit -m "adding prod_1_1.txt"
créer un repo central%git init --bare%7%More(#link=git-scm.com/docs/git-init)
créer un repo local à partir du central % git clone%7%More(#link=git-scm.com/docs/git-clone)
créer une branche % git branch%5%More(#link=git-scm.com/docs/git-add)
lister les branches % git branch -l%7%More(#link=git-scm.com/docs/git-branch)
changer de branche % git checkout%7%More(#link=git-scm.com/docs/git-checkout)
mettre un fichier sous git % git add%7%More(#link=git-scm.com/docs/git-add)
annuler un git add % git reset HEAD%7%More(#link=git-scm.com/docs/git-reset)
commit direct des modifications % git commit -a%7%More(#link=git-scm.com/docs/git-commit)
commit de l'index % git commit%7%More(#link=git-scm.com/docs/git-commit)
ajouter un oubli au commit % git commit --amend%7%More(#link=git-scm.com/docs/git-commit)
revenir au dernier commit sans perte % git stash%7%More(#link=git-scm.com/docs/git-stash)
mise à jour du repo central à partir du repo local% git push%7%More(#link=git-scm.com/docs/git-push)
mise à jour du repo local à partir du repo central% git pull%7%More(#link=git-scm.com/docs/git-pull)
mise à jour du repo central à partir d'un autre repo % git fetch%7%More(#link=git-scm.com/docs/git-fetch)
aide git en ligne % git help%7%More(#link=git-scm.com/docs/git-help)
lister l'index % git ls-files%7%More(#link=git-scm.com/docs/git-ls-files)
état répertoire courant % git status%7%More(#link=git-scm.com/docs/git-status)
voir les modifications faites dans le répertoire par rapport à celles prise en compte dans l'index % git diff%7%More(#link=git-scm.com/docs/git-diff)
voir les modifications faites dans le répertoire de travail depuis le dernier commit%git diff HEAD%7%More(#link=git-scm.com/docs/git-diff)
voir les modifications qui seront prises en compte avec la prochaine commande "git commit" % git diff --cached%7%More(#link=git-scm.com/docs/git-diff)
nettoyage du repository%git gc%7%More(#link=git-scm.com/docs/git-gc)
lister les tags % git tag -l%7%More(#link=git-scm.com/docs/git-tag)
créer un tag%git tag %7%More(#link=git-scm.com/docs/git-tag)
renommer foo en bar%git mv foo bar%7%More(#link=git-scm.com/docs/git-mv)
supprimer foo%rm foo; git rm foo%7%More(#link=git-scm.com/docs/git-rm)
autre nom de stagging area%index%6%More(#link=git-scm.com/docs/git-clone)
autre nom de index%stagging area%6%More(#link=git-scm.com/docs/git-clone)
quelle commande affiche les dépots distants%git remote -v%8%More(#link=git-scm.com/docs/git-clone)
les principaux protocols Git%file,ftp,git,http,ssh%7%More(#link=http://git-scm.com/docs/git-clone)
créer un repo central%git init --bare%7%More(#link=git-scm.com/docs/git-init)
créer un repo local à partir du central % git clone%7%More(#link=git-scm.com/docs/git-clone)
créer une branche % git branch%5%More(#link=git-scm.com/docs/git-add)
lister les branches % git branch -l%7%More(#link=git-scm.com/docs/git-branch)
changer de branche % git checkout%7%More(#link=git-scm.com/docs/git-checkout)
mettre un fichier sous git % git add%7%More(#link=git-scm.com/docs/git-add)
annuler un git add % git reset HEAD%7%More(#link=git-scm.com/docs/git-reset)
commit direct des modifications % git commit -a%7%More(#link=git-scm.com/docs/git-commit)
commit de l'index % git commit%7%More(#link=git-scm.com/docs/git-commit)
ajouter un oubli au commit % git commit --amend%7%More(#link=git-scm.com/docs/git-commit)
revenir au dernier commit sans perte % git stash%7%More(#link=git-scm.com/docs/git-stash)
update central repo from local repo % git push%7%More(#link=git-scm.com/docs/git-push)
update local repo from central repo % git pull%7%More(#link=git-scm.com/docs/git-pull)
update local repo from other repo % git fetch%7%More(#link=git-scm.com/docs/git-fetch)
aide git en ligne % git help%7%More(#link=git-scm.com/docs/git-help)
lister l'index % git ls-files%7%More(#link=git-scm.com/docs/git-ls-files)
état dir courant % git status%7%More(#link=git-scm.com/docs/git-status)
voir les modifications faites dans le répertoire par rapport à celles prise en compte dans l'index % git diff%7%More(#link=git-scm.com/docs/git-diff)
voir les modifications faites dans le répertoire de travail depuis le dernier commit%git diff HEAD%7%More(#link=git-scm.com/docs/git-diff)
voir les modifications qui seront prises en compte avec la prochaine commande "git commit" % git diff --cached%7%More(#link=git-scm.com/docs/git-diff)
nettoyage du repository%git gc%7%More(#link=git-scm.com/docs/git-gc)
lister les tags % git tag -l%7%More(#link=git-scm.com/docs/git-tag)
créer un tag%git tag %7%More(#link=git-scm.com/docs/git-tag)
rename foo to bar%git mv foo bar%7%More(#link=git-scm.com/docs/git-mv)
delete foo%rm foo; git rm foo%7%More(#link=git-scm.com/docs/git-rm)
other name for stagging area%index%6%More(#link=git-scm.com/docs/git-clone)
other name for index%stagging area%6%More(#link=git-scm.com/docs/git-clone)
which command display%git remote -v%8%More(#link=git-scm.com/docs/git-clone)
main git protocols%file,ftp,git,http,ssh%7%More(#link=http://git-scm.com/docs/git-clone)