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