Doubt use of GIT

Asked

Viewed 83 times

1

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

I know Git is decentralized, but since we have a network local code server I chose to do it the following way that it works but I want to know if it’s correct:

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

Each dev copied the source code once to your machine and the commits are directed to the repository --bare I set up on the mainframe.

In other words, in every machine I had to give one git add remote origin /endereco/do/repositorio, for when to give a commit and a push the changes direct the versioning to this directory that I have configured.

Then in the normal flow before making any changes each dev needs to give a pull to be always updated, carry out the change give the commit and the push. And so far it’s all working out so beautifully.

I wonder if this way is correct.

  • In my view, it is. because I believe that’s basically what happens with Github, for example. But I don’t know much about Git, it’s still on my list to study deeper.

  • when you say that each developer "copied" the code, you mean git clone? 'Cause that way the step git add remote origin would not need to be done, they would already be automatically linked to the original repository.

1 answer

0

You’re right in parts. The mode of decentralization is what is recommended, but with respect to the code could be like this:

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

  • Thank you very much for the reply Marlysson, I will search on the Gogs

  • Okay, anything comes back with a feedback if it works. More with gogs will be very well structured , is a great system.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.