Reza Meshkat
Reza Meshkat

Reputation: 3

Git / Gitlab working with local and remote

We have a application we are working on. The structure is as follows: we have several trusted remote admin users which have the project source file and are working with the main server. In the company we have several developers whose working on local server without internet for developing source files. They are not trusted to have the main codes except on local machine. The company server has internet connection.

We recently install gitlab on main and local servers. Pull project from main server to local and give access to developers to edit source code. On the other hand the remote admins also working with main server and change the codes. After these changes syncing the local and remote was encountered following error :

Mirror update for .... failed with the following message: The default branch (master) has diverged from its upstream counterpart and could not be updated automatically.

What is the best thing we can do to use this structure with source control system like GIT or GITLAB?

please view the company structure Image

Upvotes: 0

Views: 2018

Answers (1)

Yusef Maali
Yusef Maali

Reputation: 2431

Local git server can't be a mirror of the main server. A mirror, by definition, should not diverge from the mirrored server.

In your case, you have two servers that needs to be sync'd manually (or eventually automatically - by scripting some git hooks).

Basically , every day (or when the trusted users have made changes) the local server should be sync'd from the main server with a git merge or a git rebase.

Every day - when devs stop to work - you should sync back the main server with the local server still with a git merge or a git rebase.

Upvotes: 1

Related Questions