-
Notifications
You must be signed in to change notification settings - Fork 0
/
push-remote-git-repos.sh
executable file
·43 lines (33 loc) · 1.37 KB
/
push-remote-git-repos.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
CURR_DIR=$(cd "$(dirname "$0")"; pwd)
echo "git remote -v"
echo `git remote -v`
echo "cp config"
cp -ra $CURR_DIR/.git/config $CURR_DIR/.git/config.bak
gitName=`grep -E "url = .*.git" $CURR_DIR/.git/config|awk -F 'qiushaocloud/' '{print $2}'`
echo "gitName: $gitName"
# 推送到 gitee
#echo "推送到 gitee: [email protected]:qiushaocloud/$gitName"
#git remote set-url origin [email protected]:qiushaocloud/$gitName
#git push
# 推送到 github
echo "推送到 github: [email protected]:qiushaocloud/$gitName"
git remote set-url origin [email protected]:qiushaocloud/$gitName
git push
# 推送到 gitlab
echo "推送到 gitlab: [email protected]:qiushaoyumeng/$gitName"
git remote set-url origin [email protected]:qiushaoyumeng/$gitName
git push
# 推送到 gitcode
echo "推送到 gitcode: [email protected]:qiushaocloud/$gitName"
git remote set-url origin [email protected]:qiushaocloud/$gitName
git push
# 推送到自建的 gitea
# echo "推送到自建的 gitea: ssh://[email protected]:61322/qiushaocloud/$gitName"
# git remote set-url origin ssh://[email protected]:61322/qiushaocloud/$gitName
# git push
# 推送到自建的 gitlab
echo "推送到自建的 gitlab: ssh://[email protected]:61023/qiushaocloud/$gitName"
git remote set-url origin ssh://[email protected]:61023/qiushaocloud/$gitName
git push
echo "mv config"
mv $CURR_DIR/.git/config.bak $CURR_DIR/.git/config