Using git as the best SVN

We were an SVN store - now we use git (because all the cool kids do this).

Each developer checks the code locally on their own git tree when working on new features. When any work is ready to be sent to the main repository, we have a directory on the shared drive for each project. Then we do git push for this repo and either git sync or git pull to update a single development machine from "one true source."

We had one accident when someone clicked on a repository and somehow managed to replace the main repo with a version of their git machine tree.

Is this the best way? git?

We are located on two sites, but the shared directory is shared. A small number of developers who can generally avoid major clashes in the field of code. Everything in Windows using TortoiseGit, security is not very important, but we do not have administrator support, so there is no complicated server solution.

+4
source share
4 answers

Git is powerful. It spreads, but does not limit you to centralization if you want.

Unlike svn tho ', it is very important to set up your own conventions and ways of doing things.

A good model to follow will be illustrated in the diagram below. enter image description here

from the popular git branching model .

+4
source

Take a look at the workflows at the following link with my preference: the workflow of the integration manager (similar to the second @simon option) and correlated with the github model: http://progit.org/book/ch5-1.html

+3
source

Two common ways to use git:

  • All developers pull back and click on the central repo (as you are doing now)

  • Each developer has one private repo and one public repo. He pulls what he wants from other public repositories, and pushes only to his own public repo.

If you choose the second option and your code should not be closed, you can use github to simplify your life.

+2
source

In our project, we have a central server with gitosis managed repository with several branches. From there, each developer fetches the last changes in the branch that need to be processed, makes its own changes, compiles locally and when it is compiled and checked (if possible) pulls again (pulls any changes) and pushes.

Typically, small functions without major glitch are handled directly on the main branch, while large changes are first performed on their own branch (which can be shared by several developers in this way).

Remember to delete your branches after using them, otherwise it will be confusing. Actually, I have a special branch called branches that tracks with git merge -s ours ... links to all other branches at their decisive points (branch, merge, end), so even if I delete the branch without merging ( for example, I decided not to go along this route, or it was only some branch of error search), I still have a link to it and can revive it if necessary.

0
source

Source: https://habr.com/ru/post/1338494/


All Articles