scratch/content/html/fr/blog/05_git_create_remote_branch.md
2010-05-09 14:53:46 +02:00

914 B

kind menupriority created_at title author_name author_uri tags
article 1 2009-08-17T14:00:00+02:00 Création de branches externe avec Git Yann Esposito yannesposito.com
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.