How to work as a team with Git?

Asked

Viewed 695 times

-4

Fork and Pull Requests or direct contribution within the repository?

I’m starting a project at Github and I’m a beginner in programming. What are the best practices for working in teams? Direct contribution can be made by creating branchs for each version?

1 answer

1


I’ll try to summarize.

The first thing is for everyone to take the time to study Git and understand how it works not to screw up during versioning, especially synchronization between local and remote repositories.

Each team member can clone the project (create a local copy) and create local branches for different development purposes (patches, new features) and tinker with them.

Then you can sync to remote branches using commands like fetch, pull and push.

Branches are merged (merge) to a main branch, which is usually the master main, which despite the name has nothing special, is just a branch like any other.

Different teams use different ways to organize, for example a dev branch, a branch for production, etc. There are some attempts to standardize this out in teams that work with it professionally.

(By the way, the modification history is more beautiful and organized if you rebase instead of merge).

Fork is to create a new project from an existing one, which becomes independent of the previous one. It is not the case in the day-to-day of a team.

Pull request is for someone from outside the team to contribute to the project, for example with a bug fix.

To name release-ready versions (releases) there are tags (labels). I at least use with this intention.

  • Right. I will study to better understand the concepts and best practices. Thank you!

Browser other questions tagged

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