Skip to content

Commit

Permalink
updated git()
Browse files Browse the repository at this point in the history
  • Loading branch information
klaxalk committed May 11, 2020
1 parent 2a89ca9 commit 1b7e62b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion appconfig/shell/commons.sh_git
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,14 @@ git() {
case $* in

push*)

was_github=$(command git remote get-url origin | grep 'https://github.com' | wc -l)

# change remote to ssh
[ "$was_github" -ge 1 ] && git2ssh

# run the original command
command git "$@"
;;

pull*|checkout*|"reset --hard")
Expand Down Expand Up @@ -279,7 +285,7 @@ slack() {

# #}

# #{ auto-retry()
# #{ auto-retry()

# from https://musigma.blog/2016/12/03/ssh-auto-retry.html
function auto-retry()
Expand Down

0 comments on commit 1b7e62b

Please sign in to comment.