Bash: aliases to sync Git repos with GitHub and Bitbucket.

This commit is contained in:
Artem Sapegin 2012-11-20 00:38:53 +04:00
parent 92f327cac1
commit d50c0fc4bd
1 changed files with 17 additions and 1 deletions

View File

@ -133,4 +133,20 @@ function yay() {
echo -n "$url" | pbcopy
echo "URL copied to clipboard."
fi
}
}
# Setup syncronization of current Git repo with GitHub repo of the same name
function git-github() {
user="sapegin"
repo=`basename "$(pwd)"`
git remote add origin "git@github.com:$user/$repo.git"
git push -u origin master
}
# Setup syncronization of current Git repo with Bitbucket repo of the same name
function git-bitbucket() {
user="sapegin"
repo=`basename "$(pwd)"`
git remote add origin "https://$user@bitbucket.org/$user/$repo.git"
git push -u origin master
}