Difference between revisions of "GIT"
Line 15: | Line 15: | ||
git checkout -b ${branch_name} |
git checkout -b ${branch_name} |
||
− | |||
git push origin ${branch_name} |
git push origin ${branch_name} |
||
− | |||
git branch --set-upstream ${branch_name} origin/${branch_name} |
git branch --set-upstream ${branch_name} origin/${branch_name} |
||
− | |||
</source> |
</source> |
||
Revision as of 00:07, 19 February 2013
Branches
Ce script peut-être utile pour créér une branche locale, l'enregistrer sur le serveur remote et ensuite la faire suivre (track):
#!/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}
Pour effacer la branche distance (remote):
$> git push origin :${branch_name}