I have a question and I haven't found a topic, which fits it. I want to create a small mobile game and I plan to work on it with some friends later on. Do you guys have any tips for me how I can use git and GitHub the right way with teams? If So how to set up branches and so on the right way?

I would be happy if some of you have some information for me to share :)

  • \$\begingroup\$ You are asking two separate questions. One about how to use Git and another about version numbers. Please note that questions on stack exchange should only ask about one thing at a time. That way people who can only answer one of the question can do so without having to post an incomplete answer. I took the liberty to remove the version numbering question and only left the question about git. If you want to know more about version numbers, please ask that question separately. \$\endgroup\$
    – Philipp
    Commented Mar 9, 2022 at 21:18

1 Answer 1


There are two main competing philosophies regarding how to use git for collaborative software development.

The first is the more simple "trunk" process. In this case there is one main branch, and everyone commits to that branch. Everyone is responsible for making sure that their commits don't break anything. Developers are encouraged to pull regularly from the trunk branch and integrate the commits from other developers with their own work-in-progress and thus avoid diverging too far from the trunk.

This process has the advantage that looking at the main branch gives a very good idea of what is currently going on in the project. And the lack of red tape also means that small and simple changes are easy to get into the main branch and then to end-users. Unfortunately careless developers can easily cause chaos in such a project by committing poorly tested code changes or half-finished features to the main branch which they then never get around to finish.

The second is the so-called "git flow" process. In this case there is still one main branch, but nobody commits to that branch directly. All the development happens on separate branches, usually one for each feature. When a feature is completed, that branch is reviewed, and only then merged into the main branch. Github supports this process very well. The website makes it easy for users to create branches of other peoples projects, and then request for their branch to get merged back into the main project by creating a "pull request" which the maintainer of the main project can then accept or reject.

The git flow has the advantage that the main branch is always free of any untested or half-completed features. But on the other hand, having branches with longer histories developed independently over longer timeframes can make merging challenging at times.

When you enter "git flow vs. trunk" into your favorite search engine, then you are going to find a lot of blog posts which make lots of arguments about when to use which one and why. But in the end, which process is "the right" process for your team is for your team to decide.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .