Git

Configuration

Modifier l'éditeur de git

git config core.editor "xemacs"


Modifier l'outil de merge

git config merge.tool kdiff3


Conserver les retour lignes du repo distant

##git windows force linux mode for one repo
git config core.autocrlf input


Soumettre des modifications

Ajout des modifications en local (staging)

git add .


Suppression des modifications faites en local

git reset --hard HEAD


Suppression des fichiers non suivis par git en local

git clean -f -d


Soumission

# l'option -a fait aussi l'ajout des modifications dans l'index
# équivalent de git add . suivi de git commit
git commit -a


Modifier le commentaire du dernier commit

git commit --amend "nouveau commentaire"


Information Information:  Il est possible de ne pousser qu'un commit à la fois
git push <REMOTE> <sh1 of commit>:<branch>


Mettre à jour la branche distante

git push <REMOTE> <name of branch>


Label

Poser un label

git tag <nameoftag> <name of commit>


Mettre à jour le label distant

git push <REMOTE> <name of tag>

Renommer un label

git tag <new> <old>           # Create a new local tag named `new` from tag `old`.
git tag -d <old>            # Delete local tag `old`.
git push origin <new> :<old>  # Push `new` to your remote named "origin", and delete
                          #     tag `old` on origin (by pushing an empty tag
                          #     name to it).


Renommer une branche

See
#en local
git branch -m <old-name> <new-name>
#en distant
git push origin :<old-name> <new-name>



Ajouter une source pour le repo distant

Par exemple pour rebaser la branche locale

git remote add upstream https://github.com/jmcameron//attachments.git
git fetch upstream
git rebase upstream/attachmentsid



Liens Externes

MediaWiki spam blocked by CleanTalk.