From 1d5e6d6662102a94b2040480b0368d32c79181b2 Mon Sep 17 00:00:00 2001 From: Artem Sapegin Date: Tue, 27 Nov 2012 18:04:43 +0400 Subject: [PATCH] Bash: repo option for git-github/git-bitbucket aliases. --- includes/bash_functions.bash | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/bash_functions.bash b/includes/bash_functions.bash index 5e0037f..e2e0610 100644 --- a/includes/bash_functions.bash +++ b/includes/bash_functions.bash @@ -136,17 +136,19 @@ function yay() { } # Setup syncronization of current Git repo with GitHub repo of the same name +# USAGE: git-github [repo] function git-github() { user="sapegin" - repo=`basename "$(pwd)"` + repo=${1-`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 +# USAGE: git-bitbucket [repo] function git-bitbucket() { user="sapegin" - repo=`basename "$(pwd)"` + repo=${1-`basename "$(pwd)"`} git remote add origin "https://$user@bitbucket.org/$user/$repo.git" git push -u origin master }