eval $(ssh-agent -s)
ssh-add ~/.ssh/*_rsa
git log -p [FICHIER]
git log --oneline --since="1.week" --author="TOTO"
git log --author="TOTO" --since="1.week" --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'
git shortlog --since="1.week"
git log --pretty="%H" --author="[YOUR_NAME]"| while read commit_hash; do git show --oneline --name-only $commit_hash | tail -n+2; done | sort | uniq|grep ".php"
git log --format=format: --name-only | grep -v '^$' | sort | uniq -c | sort | tail -100
git lg -S "[WORDS]" -1 -p index.html
git reflog
git diff -w > patches/[FILE].patch
git diff -w [FILE] > patches/[FILE].patch
git diff -w > [description]-[issue-number]-[comment-number].patch
http://blog.fclement.info/contribuer-en-tant-que-developpeur-a-drupal-via-drupal-org
git add -A
git ci -m 'XXX'
git format-patch origin/master
git shortlog -sne
git checkout -b [LOCAL-BRANCH] origin/[REMOTE-BRANCH]
git checkout -b [BRANCH]
git checkout -- [FILE]
git reset --hard
git checkout <numéro de commit grâce à git log>
git commit -m "ce que j'ai fait"
git fetch
(pour avoir toutes les modifs effectuées sur toutes les branches)
git merge -s recursive --no-commit origin/master
(change de mode de merge et ne commit pas)
Si conflit, lire ce que dit git à la fin (généralement, faut refaire un commit)
git checkout prod
git pull
git log prod..master ou git diff prod master
pour voir les différences
git merge master
git push
git diff branch1:file1 branch2:file2
git diff --no-index -- previous_release new_release
git push -f origin [BRANCH]
git status --porcelain | grep -E '^[^D\?]{2} .*\.php$' | awk '{print $2}' | xargs -n1 phpcs --standard=drupal | more
git tag
git push origin --tag
git reset HEAD^
git submodule add <repo> <sites/all/modules/custom/my_module>
git add [FILES]
git commit --amend
La même chose qu'au dessus puis git push origin HEAD --force
git reset --hard <sha1-commit-id>
git push origin HEAD --force
git rebase -i <sha1-commit-id>~1
Suivre les instructions proposées par GIT (effacer une ligne de commit efface le commit)
git push origin HEAD --force
https://help.github.com/articles/changing-author-info
https://stackoverflow.com/questions/179123/edit-an-incorrect-commit-message-in-git
=> Rajouter les serveurs dans :
vim ~/.ssh/config
Host git.mdp.net
IdentityFile ~/.ssh/id_rsa_mine
wget https://raw.github.com/git/git/master/contrib/completion/git-prompt.sh
sudo wget https://raw.github.com/git/git/master/contrib/completion/git-completion.bash /etc/bash_completion.d/git
Copy to ~/git-prompt.sh and reload the configuration => source ~/git-prompt.sh