Search code examples
gitversion-controlbranchcollaborationbranching-strategy

Coder collaboration best practices using Git


I'm having some troubles in understanding Git team-working principles.

Consider a team of two programmers: A and B. They are working on a Project. Also, there is a remote server with a repo on it. A and B are collaborating remotely. There are some code in the repo already.

I have a favour to ask you for help on organizing their step-by-step workflow on Git.
1. Have they to create their own local branches?
2. How they could upload working code on a production server? rsync?

Any help will be appreciated.


Solution

  • It is not required for programmers to create their own branch to work. In the simplest case, programmers will commit to the "master" branch of their own repository, then git push those commits to the upstream repository.

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

    Developers can optionally create their own branches for either their own use (in their local repository only), or branches for sharing with others (by pushing the branches up to the shared repository).