# YBlog - Git remote branch creation
Keywords: git, branch, local, remote

French ↓ Menu ↓

# Git remote branch creation

## easiest remote Git branch creation

I use git simply to synchronize stuff for personnal projects. Therefore, when I create a local branch I want most of time this branch to be created remotely.

Here is the script I use to achieve that:

    #!/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}

Of course, I suppose `origin` is already configured.

Edit: Now I use `git push -u`

RSS · Tweet · FB
These social sharing links preserve your privacy
↑ Top ↑
Published on 2009-08-17
Follow @yogsototh
Yann Esposito©
Done with Vim spacemacs & nanoc Hakyll

ADA: `DdzFFzCqrhtAvdkmATx5Fm8NPJViDy85ZBw13p4XcNzVzvQg8e3vWLXq23JQWFxPEXK6Kvhaxxe7oJt4VMYHxpA2vtCFiP8fziohN6Yp`