Git

From Anthony Pastor Wiki Notes - Verba volant, scripta manent
Revision as of 10:41, 28 October 2016 by Anthoanthop (talk | contribs) (Created page with "Pour lister les branches existantes dans le repository local: git branch Pour créer une branche en local, il suffit de faire: git branch nom-de-la-branche Pour basculer...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Pour lister les branches existantes dans le repository local:

git branch 

Pour créer une branche en local, il suffit de faire:

git branch nom-de-la-branche

Pour basculer sur une branche donnée et travailler dessus:

git checkout nom-de-la-branche

Pour pusher la branche actuelle vers le repository distant:

git push origin nom-de-la-branche

Pour lister les branches distantes:

git remote show origin

Pour un autre développeur qui voudrait utiliser la branche nom-de-la-branche

git fetch origin
git checkout origin/nom-de-la-branche

La première commande met à jour le repository local avec les changements présents dans le repository ditant. La deuxième crée une branche locale « nom-de-la-branche » câblée sur la branche distante.

Source : http://www.letuyau.net/2012/08/git-pusher-une-branche-sur-un-repository-distant/