Archives par mot-clé : git

Note sur git

Supprimer un fichier de l’historique :

 git filter-branch --index-filter 'git rm --cached --ignore-unmatch install ${FICHIER}' -f

Changer l’historique des commits

 git rebase -i HEAD~15
  • on tombe sur un menu avec une liste du plus ancien au plus nouveau commit, par exemple 15, remonte jusqu’à 15 commit. Il est possible de changer l’ordre, de fusionner (squash) des commits.
# p, pick = use commit
# r, reword = use commit, but edit the commit message
# e, edit = use commit, but stop for amending
# s, squash = use commit, but meld into previous commit
# f, fixup = like "squash", but discard this commit's log message
# x, exec = run command (the rest of the line) using shell
# d, drop = remove commit
  • Enfin, on push :
git push origin +master