Doubt use of GIT

1

My question is limited to whether the way I did it is correct to use Git within the company where I work.

I know that Git is decentralized, however as we have local code server on network I have chosen to do the following way that works but I want to know if it is correct:

On the server where all devs has access I created a git init --bare to receive commits .

Each dev copied the source code once for your machine and the commits is directed to the --bare pository that I set up on the central server.

That is, on each machine I had to give git add remote origin /endereco/do/repositorio , so when I give a commit and a push the changes direct the versioning to this directory that I set up.

Then in the normal flow before making any changes every dev needs to give a pull to be always updated, make the change give commit and push . And so far everything is working.

I wonder if this is correct.

    
asked by anonymous 06.03.2017 / 01:26

1 answer

0

You're right in parts.  The decentralization mode is what is recommended, but with respect to the code it might look like this:

You put an application on the server that works as a github of life, for example Gitlab or Gogs (recommend) with it you would have an application managing the repositories and could create several repositories with several branches in each .. How the github .. Continuing the decentralization of the code .. And at the time of deploy only need on the application server to clone the address of the stable code of the application where the code is. Thus leaving each application on the server with its function .. Be either code repository or application hosting (mirroring the stable code).

    
06.03.2017 / 05:46