0

this is my first time posting here, so please go easy on me if I am not giving enough information.

Background: I am tasked to implement git and version control for the company I am currently working at, while this sounds really easy, it is not that easy.

At the company we are using an ERP-System, called abas ERP that has no native support for git. Abas ERP is highly customize-able and ours is highly customized, what hasn't been done is setting up a proper versioning and source control

The current way to version things is to just add tags to the file header, comments in the source and save a copy of the previous source file, with a timestamp. Which obviously is not the best way to do things.

For the infrastructure: The current setup of abas is to have several live/production clients with one being the main, they are supposed to have the same code and any potential different behaviors are to be handled in the code by just branching the code depending which client a user is connected to.

Serving to the live clients are development clients, on those development and testing happens. One of them is a clone of the main client, that gets cloned of the master live client daily, to always be able to test against the most up to date data and live implementations.

Usually to this point the writing of code does not happen locally on a developer's machine, but in a fashion through the GUI of the ERP-Software, directly in the client-server of a development Client.

When wanting to implement or test new code on the test client that is updated daily or on the live client, currently the developer manually copies over changed files, imagine copy & paste and then tests it there.

Sometimes, in cases of very time sensitive fixes they are on occasion hot fixed directly on live clients.

Idea for the actual implementation

The intention is to have a repository in each client, development and live. Not bare, so files can be technically edited on the clients. And to have one bare repository that stores all developments with a production branch that directly feeds into the live clients, when it has changes.

This might be the first problem, as stated the source on the live client sometimes get's changed directly, so it can not be a bare repository. Those changes should be mirrored back to the bare repositories production branch.

Question - Git throws error's when trying to push to a checked out branch. And I am not sure how to get around it, any ideas?

  • In essence the production branch on the bare repository should always be identical with the files on the live clients and that syncing should potentially be able to happen in both direction and automatically. (I know not optimal.)
Rick
  • 1
  • You can push into a [configured](https://stackoverflow.com/a/28383598/7976758) non-bare repo. Or you can pull instead; this is the preferred solution. – phd Dec 17 '21 at 12:01
  • As in make it a crontab and have the pull run every minute or so? I can't really pull with a hook, right? At least not when both is on different machines? – Rick Dec 17 '21 at 12:40
  • Very much depends on how you can connect from bare-repo host to non-bare. If you have SSH access you can have a `post-receive` or a `post-update` hook in the bare repo that ssh to non-bare repo host and does pull. – phd Dec 17 '21 at 12:44
  • I actually should be able to do that. That is an idea, I will try that. Thank you. – Rick Dec 17 '21 at 12:56

0 Answers0