Recommendations for working with coders using Git

I am having trouble understanding the principles of Git teamwork.

Consider a team of two programmers: A and B They are working on Project . In addition, it has a remote server with a repo. A and B work remotely. The repo already has code.

I have a request to help you organize their step-by-step workflow on Git.
1. Ask them to create their own branches? 2. How could they upload working code to a production server? rsync ?

Any help would be appreciated.

+4
source share
2 answers

For programmers, you do not need to create your own branch for work. In the simplest case, programmers pass the β€œleading” branch of their own repository, and then git push those that are taken upstream to the repository.

To deploy to a production server, one way to do this is to use git clone on the production server to get the local repository. Then, to upgrade the production server, log in and git pull . Any changes that were committed to the main repository will be applied.

Developers can optionally create their own branches for their own use (only in their local repository) or branches for sharing with others (by pushing branches into a common repository).

+2
source
  • Each developer will have their own repository clone. They can create branches to work on topics as and when they want. Their personal clone is their own turf; they can do whatever they want.

  • Each developer should have their own remote public repository, which they can push / pull to / from. Typically, if you want to release a code, there will be one person who finally decides what is going to go into the release and what will be cut. This remote repository must have a branch that represents stable releases. Say A is the release manager who wants to include work B in the release. Then A will wait until B pushes his work to his own remote repo. Then A will pull B to its local clone, try everything, combine, commit and click on its public repo (A) for release.

In (2), I described only one of many different workflows available for use with distributed SCM, such as git. There are many others. This page from ProGit is especially good at describing some others.

0
source

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


All Articles