-
Notifications
You must be signed in to change notification settings - Fork 2
/
gitlab-to-github.sh
executable file
·32 lines (25 loc) · 1.03 KB
/
gitlab-to-github.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
#!/bin/zsh
# Arguments:
# ${1}: Username
# ${2}: Repository
# Clone the repo from GitLab using the `--mirror` option.
# git clone --mirror "[email protected]:${1}/${2}.git"
# git add . && git commit -m "Local push"
#
# # Push to GitHub using the `--mirror` option. The `--no-verify` option skips any hooks.
# # git -C "${2}" push --no-verify --mirror "[email protected]:${1}/${2}.git"
# # git push --no-verify --mirror [email protected]:buluma/ansible-role-keepalived.git
# git push origin-new
# Set push URL to the mirror location.
# git -C "${2}" remote set-url --push origin "[email protected]:${1}/${2}.git"
# git remote set-url --push origin-new [email protected]:buluma/ansible-role-keepalived.git
# To periodically update the repo on GitHub with what you have in GitLab.
# git -C "${2}" fetch -p origin
# git -C "${2}" push --no-verify --mirror
# V3rsion 2
# git remote add origin-new [email protected]:buluma/ansible-role-keepalived.git
echo "Pushing to GitLab.."
git remote -v
git add . && git commit -m "Local push"
git push gitlab
# git push origin