kogakure (owner)

Revisions

gist: 218467 Download_button fork
public
Description:
Git: New remote branch
Public Clone URL: git://gist.github.com/218467.git
Embed All Files: show embed
Bash #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh
# http://www.zorched.net/2008/04/14/start-a-new-branch-on-your-remote-git-repository/
# git-create-branch <branch_name>
 
if [ $# -ne 1 ]; then
echo 1>&2 Usage: $0 branch_name
         exit 127
fi
branch_name=$1
git push origin master:refs/heads/$branch_name
echo "git push origin master:refs/heads/$branch_name"
git fetch origin
git checkout --track -b $branch_name origin/$branch_name
git pull