將 origin 倉庫由 Gitee 改爲 GitHub

#!/usr/bin/env bash # Author: Shixiang Wang # LICENSE MIT@2020 echo "This program reset the origin repository from gitee to github." remote=$(git status && echo $(git remote -v | grep fetch | sed -E 's/.*(http[s][^ ]*).*/\1/') || echo "Not a git repo") if [[ $remote == "Not a git repo" ]]; then echo "!! Not a git repo, exit..." exit 1 fi remote=$(echo $remote | sed -E 's/.*(http[s][^ ]*)$/\1/') remote=$(echo $remote | sed -E 's/gitee/github/') git remote remove origin git remote add origin $remote echo "Done."
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章