Astuces Git

Découper les changements dans un commit

git add -p

-p, –patch Interactively choose hunks of patch between the index and the work tree and add them to the index. This gives the user a chance to review the difference before adding modified contents to the index.

This effectively runs add –interactive, but bypasses the initial command menu and directly jumps to the patch subcommand. See “Interactive mode” for details.

Retourner à la branche précédente

git checkout -

Lister les fichiers ignorés

git check-ignore *