Voir fichier à un commit :
git show HASH:path/to/file
Hash du commit initial :
git rev-list --max-parents=0 HEAD
Voir liste fichiers modifiés entre 2 commits :
git diff --name-only SHA1 SHA2
git log --name-status --oneline HEAD~6..HEAD
git log --name-status --oneline HEAD~6..HEAD |grep -vP '^\S[^\s]'|sort|uniq
Voir modif sur un fichier entre 2 commits :
git diff SHA1 SHA2 main.c
Trouver l'ancetre commun le plus vieux
git config --global alias.oldest-ancestor '!bash -c '\''diff -u <(git rev-list --first-parent "${1:-master}") <(git rev-list --first-parent "${2:-HEAD}") | sed -ne "s/^ //p" | head -1'\'' -'
git oldest-ancestor
git rebase -i [HASH parent]
man -7 gitrevisions
HEAD
HEAD~1 HEAD^ HEAD^1
HEAD~2 HEAD^2 HEAD~1^
HEAD~3
10:10 V /tmp/git_test [master L|V]
$ git lola
-
https://links.infomee.fr/?wo2tCAHEAD^ is the revision before the current
HEAD~2 is the same as HEAD^^ and the revision before HEAD^
-
https://coderwall.com/p/wjlqvw/git-revision-magic-like-a-bossgit branch -a --sort=-committerdate
-
https://links.infomee.fr/?zqUo2Qje découvre ce plugin vim qui a l'air juste magique pour interagir avec git
-
http://vimcasts.org/episodes/fugitive-vim-working-with-the-git-index/il faut que je me fasse au workflow "Branch updater"
-
https://confluence.atlassian.com/bamboo/using-plan-branches-289276872.htmlThe -m option specifies the parent number. This is because a merge commit has more than one parent, and Git does not know automatically which parent was the mainline, and which parent was the branch you want to un-merge.
When you view a merge commit in the output of git log, you will see its parents listed on the line that begins with Merge:
commit 8f937c683929b08379097828c8a04350b9b8e183
Merge: 8989ee0 7c6b236
Author: Ben James ben@example.com
Date: Wed Aug 17 22:49:41 2011 +0100
Merge branch 'gh-pages'
Conflicts:
README
In this situation, git revert 8f937c6 -m 1 will get you the tree as it was in 8989ee0, and git revert -m 2 will reinstate the tree as it was in 7c6b236.
-
http://stackoverflow.com/questions/7099833/how-to-revert-a-merge-commit-thats-already-pushed-to-remote-branchdon't fucking commit useless binary files !!
-
http://stevelorek.com/how-to-shrink-a-git-repository.html.ssh/authorized_keys
environment="GIT_AUTHOR_NAME=Arnaud M",environment="GIT_AUTHOR_EMAIL=arnaud@foo.bar",environment="GIT_COMMITTER_NAME=Arnaud M",environment="GIT_COMMITTER_EMAIL=arnaud@foo.bar" ssh-rsa .....
Peut être pratique quand plusieurs personnes commit depuis le même serveur (pour avoir un historique git avec les noms..)
-
http://cweiske.de/tagebuch/carry-git-settings.htmUn workflow git qui a le mérite d'être simple : le cactus
-
https://barro.github.io/2016/02/a-succesful-git-branching-model-considered-harmful/Ptetre qu'un jour je passerai à zsh (ohmyzsh)
En attendant je bricole
-
https://github.com/jimeh/git-aware-promptPour cancel un commit qui n'a pas encore été push
git reset --soft HEAD^
-
http://stackoverflow.com/questions/12481639/remove-files-from-git-commitShow what will be deleted with the -n option:
git clean -f -n
Then - beware: this will delete files - run:
git clean -f
-
http://stackoverflow.com/questions/61212/how-do-i-remove-local-untracked-files-from-my-current-git-branchPratique pour cloner en http
servir betement avec apache
-
https://links.infomee.fr/?Opxcxw