bin

bin
git clone git://git.zepp.club/bin.git
Log | Files | Refs | README | LICENSE

gcr (715B)


      1 #!/bin/sh
      2 #
      3 # Simple script to toggle github remote to git
      4 
      5 repo_remote="$(git remote get-url origin || exit 1)"
      6 
      7 case $repo_remote in
      8     *https*github*)
      9         repo=${repo_remote##https://github.com/}
     10         repo=${repo%%.git}
     11         repo=git@github.com:$repo.git
     12         echo 'signing key changed'
     13         git config user.signingkey C7509FB0D2DE4B09
     14         git config user.email 82726847+xeinye@users.noreply.github.com
     15         git config user.name xeinye
     16 ;;
     17 	*git://git.zepp.club*)
     18         repo=${repo_remote##git://git.zepp.club/}
     19         repo=${repo%%.git}
     20         repo=git@git.zepp.club:${repo##*/}
     21     ;;
     22 
     23     *) exit 1 ;;
     24 esac
     25 
     26 printf 'Changing repo to %s\n' "$repo"
     27 git remote set-url origin "$repo"
     28