scratch/content/html/fr/blog/05_git_create_remote_branch.md
Yann Esposito (Yogsototh) c85e6fbbdc nettoyage fr
2010-04-29 16:59:14 +02:00

858 B

kind menupriority created_at title tags
article 1 2009-08-17T14:00:00+02:00 Création de branches externe avec Git
git
branch
local
remote

Créer une branche Git externe facilement

J'utilise Git pour synchroniser des projets personnels. C'est pourquoi quand je crée une branche locale je souhaite quasiment toujours qu'elle soit aussi créée en externe (remote).

Voici le script que j'utilise pour accomplir cette tâche :

#!/usr/bin/env zsh

if (($#<1)); then print -- "usage: $0:t branch_name" >&2 exit 1 fi

branch=$1 git br ${branch} git co ${branch} git config branch.${branch}.remote origin git config branch.${branch}.merge refs/heads/${branch}

Bien sûr, je suppose qu'origin est déjà configurée.