From d50c0fc4bd606d3603d7ddc86ddcf1698290ddfc Mon Sep 17 00:00:00 2001 From: Artem Sapegin Date: Tue, 20 Nov 2012 00:38:53 +0400 Subject: [PATCH] Bash: aliases to sync Git repos with GitHub and Bitbucket. --- includes/bash_functions.bash | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/includes/bash_functions.bash b/includes/bash_functions.bash index f383240..863f66c 100644 --- a/includes/bash_functions.bash +++ b/includes/bash_functions.bash @@ -133,4 +133,20 @@ function yay() { echo -n "$url" | pbcopy echo "URL copied to clipboard." fi -} \ No newline at end of file +} + +# 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 +}