Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gitlab2github
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Recolic
gitlab2github
Commits
65809ac9
There was an error fetching the commit references. Please try again later.
Commit
65809ac9
authored
4 years ago
by
Bensong Liu
Browse files
Options
Downloads
Patches
Plain Diff
allow disable sync
parent
3e2045ed
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gitlab2github_sync.fish
+10
-0
10 additions, 0 deletions
gitlab2github_sync.fish
with
10 additions
and
0 deletions
gitlab2github_sync.fish
+
10
−
0
View file @
65809ac9
...
...
@@ -13,6 +13,15 @@ function echo2
echo $argv 1>&2
end
function assert_this_repo_allows_sync
# We can use `echo sync=0 > .gitlab2github.conf` to disable the sync
# Return 0 if ok to sync, return 1 if sync is disabled.
grep 'sync=0' .gitlab2github.conf > /dev/null 2>&1
and echo2 "Disable sync for repo "(pwd)
and return 1
or return 0
end
function sync_one_project
set project_name $argv[1]
set project_url $argv[2]
...
...
@@ -46,6 +55,7 @@ function sync_one_project
# https://stackoverflow.com/questions/67054889/force-git-pull-to-resolve-divergent-by-discard-all-local-commits
and git fetch
and git reset --hard "@{upstream}"
and assert_this_repo_allows_sync
and git push --tags --force dst (git branch --show-current)
and cd ..
or return 4
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment