Ceci est une ancienne révision du document !


Mes réglages

Pour avoir un log plus détaillé que la simple commande git log , créez un alias dans le fichier ~/.gitconfig pour avoir un rendu avec un graphique. source

[alias]
lg = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(auto)%d%C(reset)' --all

Modification remote

Pour lister les URL

$ git remote -v
origin  git://github.com/schacon/ticgit.git (fetch)
origin  git://github.com/schacon/ticgit.git (push)

Pour changer l'URL du remote

$ git remote -v
origin  git://github.com/schacon/ticgit.git (fetch)
origin  git://github.com/schacon/ticgit.git (push)
$ git remote set-url origin git://github.com/github/git-reference.git
origin  git://github.com/github/git-reference.git (fetch)
origin  git://github.com/github/git-reference.git (push)

Diverses commandes

Supprimer une branche sur le server distant

git push --delete repo branch

Déplacer origin/master

git rebase --onto XXX

XXX correspond au numéro de commit

todo : git prompt (git_prompt_help) https://github.com/magicmonty/bash-git-prompt