Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
c4cba180
Commit
c4cba180
authored
Nov 26, 2019
by
philipp-rs
Committed by
Marcia Ramos
Nov 26, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve repository mirroring documentation
parent
18df46fd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
doc/user/project/repository/repository_mirroring.md
doc/user/project/repository/repository_mirroring.md
+15
-0
No files found.
doc/user/project/repository/repository_mirroring.md
View file @
c4cba180
...
...
@@ -143,6 +143,7 @@ Changes pushed to the upstream repository will be pulled into the GitLab reposit
CAUTION:
**Caution:**
If you do manually update a branch in the GitLab repository, the branch will become diverged from
upstream and GitLab will no longer automatically update this branch to prevent any changes from being lost.
Also note that deleted branches and tags in the upstream repository will not be reflected in the GitLab repository.
### How it works
...
...
@@ -247,6 +248,10 @@ If you need to change the key at any time, you can remove and re-add the mirror
to generate a new key. You'll have to update the other repository with the new
key to keep the mirror running.
NOTE:
**Note:**
The generated keys are stored in the GitLab database, not in the filesystem. Therefore,
SSH public key authentication for mirrors cannot be used in a pre-receive hook.
### Overwrite diverged branches **(STARTER)**
> [Introduced](https://gitlab.com/gitlab-org/gitlab/merge_requests/4559) in [GitLab Starter](https://about.gitlab.com/pricing/) 10.6.
...
...
@@ -362,6 +367,7 @@ proxy_push()
branch
=
$(
expr
"
$refname
"
:
"refs/heads/
\(
.*
\)
"
)
if
[
"
$whitelisted
"
=
"
$branch
"
]
;
then
unset
GIT_QUARANTINE_PATH
# handle https://git-scm.com/docs/git-receive-pack#_quarantine_environment
error
=
"
$(
git push
--quiet
$TARGET_REPO
$NEWREV
:
$REFNAME
2>&1
)
"
fail
=
$?
...
...
@@ -396,6 +402,15 @@ else
fi
```
Note that this sample has a few limitations:
-
This example may not work verbatim for your use case and might need modification.
-
It does not regard different types of authentication mechanisms for the mirror.
-
It does not work with forced updates (rewriting history).
-
Only branches that match the
`whitelisted`
patterns will be proxy pushed.
-
The script circumvents the git hook quarantine environment because the update of
`$TARGET_REPO`
is seen as a ref update and git will complain about it.
### Mirroring with Perforce Helix via Git Fusion **(STARTER)**
CAUTION:
**Warning:**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment