git

git add *
git status
git status -s
git commit -a -m 'message'

annuler changements locaux

remodifier les fichiers :

git reset --hard

supprimer les nouveaux fichiers :

git clean

https://www.atlassian.com/fr/git/tutorials/undoing-changes

mettre de côté :

git stash

puis récup :

git stash pop

ajouter changements au dernier commit

git commit --amend --no-edit

ou changer le dernier message :

git commit --amend -m "an updated commit message"

https://www.atlassian.com/fr/git/tutorials/rewriting-history

supprimer fichier

virer un fichier commit par erreur (avec mot de passe par ex.) :

git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch PATH-TO-YOUR-FILE-WITH-SENSITIVE-DATA' --prune-empty --tag-name-filter cat -- --all

.gitignore

Ignore files that have already been committed to a Git repository

nommer les commits

<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>

exemples

fix: fix foo to enable bar

This fixes the broken behavior of the component by doing xyz. 

BREAKING CHANGE
Before this fix foo wasn't enabled at all, behavior changes from <old> to <new>

closes #1, closes #2
feat(lang): add Polish language; closes #2

pull requests

https://www.atlassian.com/fr/git/tutorials/making-a-pull-request

submodules

git submodule update --init --recursive
git clone --recurse-submodules