GIT: Difference between revisions

From hugovil.com
Jump to navigationJump to search
New page: #!/bin/bash # git-create-branch <branch_name> if [ $# -ne 1 ]; then echo 1>&2 Usage: $0 branch_name exit 1 fi branch_name=$1 git checkout -b ${branch_name} git push origin ${b...
 
No edit summary
Line 1: Line 1:
<source lang="bash">
#!/bin/bash
#!/bin/bash


Line 15: Line 16:


git branch --set-upstream ${branch_name} origin/${branch_name}
git branch --set-upstream ${branch_name} origin/${branch_name}
</source>


# To delete the remote branch:
# To delete the remote branch:
# git push origin :${branch_name}
# git push origin :${branch_name}

Revision as of 04:05, 19 February 2013

#!/bin/bash

# git-create-branch <branch_name>

if [ $# -ne 1 ]; then
    echo 1>&2 Usage: $0 branch_name
    exit 1
fi

branch_name=$1

git checkout -b ${branch_name}

git push origin ${branch_name}

git branch --set-upstream ${branch_name} origin/${branch_name}
  1. To delete the remote branch:
  2. git push origin :${branch_name}