-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgitmigrate.sh
More file actions
24 lines (20 loc) · 921 Bytes
/
gitmigrate.sh
File metadata and controls
24 lines (20 loc) · 921 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash
#wscnbackend project
project_name=(ivankagateway ivankadelegate ivankadedicate ivankauser ivankacontent ivankanginy ivankapush ivankacomment ivankaprovision forexdata ivankafinfo ivankabridge apiconf ivankastore ivankaudata ivankasearch ivankamigrate marketdata ivankacooperation ivankaoauth ivankarealtime ivankatoutiao)
#wscnfrontend project
#project_name=(juicy weex ivanka-trump ivanka-mobile wscn-chart goldtoutiao ivanka-premium-marticle wx-mina)
source_repo=git@***:wscnbackend
target_repo=git@***:wscnbackend
rootdir=`dirname $0`
cachedir=$rootdir/gitmigratecache
for project in ${project_name[@]}; do
git clone $source_repo/$project $cachedir
pushd $cachedir
for r in `git branch -r|grep -v 'master\|HEAD'`; do
git branch ${r#*/} --track $r
done
git push --all $target_repo/$project.git
git push --tags $target_repo/$project.git
popd
rm -rf $cachedir
done