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>
- feat – a new feature is introduced with the changes
- fix – a bug fix has occurred
- chore – changes that do not relate to a fix or feature and don't modify src or test files (for example updating dependencies)
- refactor – refactored code that neither fixes a bug nor adds a feature
- docs – updates to documentation such as a the README or other markdown files
- style – changes that do not affect the meaning of the code, likely related to code formatting such as white-space, missing semi-colons, and so on.
- test – including new or correcting previous tests
- perf – performance improvements
- ci – continuous integration related
- build – changes that affect the build system or external dependencies
- revert – reverts a previous commit
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