222 private links
Applying a range of commit in git : git cherry-pick fromCommit..ToCommit
Interactive cheatsheet with remise, working directory, index, local repository and remote repository columns
(from sebsauvage)
Well, the content is substantial
Related :
Improving the use of vim-fugitive of some shortcuts and command
GA = General availability (a release); should be very stable and feature complete
RC = Release candidate; probably feature complete and should be pretty stable - problems should be relatively rare and minor, but worth reporting to try to get them fixed for release.
M = Milestone build - probably not feature complete; should be vaguely stable (i.e. it's more than just a nightly snapshot) but may still have problems.
SR = Service Release (subsequent maintenance releases that come after major -RELEASE).
Créer des représentations graphiques de dépôt git.
- Rename your local branch
git branch -m old-name new-name
or simplygit branch -m new-name
for the current branch. - Delete the old-name remote branch and push the new-name local branch
git push origin old-name new-name
- Reset the upstream branch for the new-name local branch
git push origin -u new-name
Le glossaire de git avec les mot-clés / vocabulaire spécifique
Summary
--soft
change only the HEAD--mixed
(default) change the HEAD and the index--hard
change the HEAD, the index and the working directory
Utiliser ensemble git commit --fixup
et git rebase --autosquash
pour nettoyer rapidement son historique de commits.
De la lecture supplémentaire pour mieux comprendre
Le beau git rebase -i
qui fait le café, lorsque le café n'a pas été fait <3
Ça explique bien deux options de git add
:
- le mode interactif afin de sélectionner les fichiers à place dans la Staging Area avec l'option
-i
. - le mode partiel de
git add
qui permet d'inclure seulement certaine(s) portion(s) d'un fichier dans la Staging Area ( avec l'option-p
) <3
Un mémo
À ajouter dans le .bashrc / autre fichier
# Check git branches
parse_git_branch () {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1) /'
}
export PS1="$PS1\$(parse_git_branch) "
Pour être plus propre, redéfinir directement la variable $PS1
en ce que vous souhaitez. Par défaut : `${debian_chroot:+($debian_chroot)}[\033[01;32m]\u@\h[\033[00m]: ↪[\033[01;34m]\w[\033[00m]\$ $(parse_git_branch)``fera le taf.
Les alias pour git permettent de gagner du temps et d'avoir moins de charge cognitive :+1:
git add -p
permet d'indexer partiellement les fichiers dans un mode interactif !
L'extension GitLens pour VScode pour connaître qui a effectué la modification sur chaque ligne. Je viens de trouver un plugin similaire à GitLens pour vim : Blamer.