Best GIT practice when you are just starting up.

This article is for beginners who have just started using GIT.

Today, I have come up with the best practices that you can do when you and your team are using GIT. As we all know that GIT is a version control system, but different versions merging may cause conflicts when members are working on the same features. We can follow some simple procedures to avoid that.

First of all, fetch the project from the GIT that you have to build a feature on. Let us consider that it is on the master branch. Now what we usually do is, create a local branch to develop the new feature on, and then when everything is tried and tested merge it with the master branch. But when you develop many features the master branch sometimes may not be stable or unforeseen problems may arise like the development of one feature might in some way affect others. In my case, I had developed four features and pushed them one by one, and merged them with the master branch. But, when there are problems within the features it makes the migration branch unstable.

So it is better to always have a stable branch that you can look back to if you want to start things all over again or just get a fresh copy. For that, you have to be absolutely sure before you push anything to the main branch, which here for example we have chosen to be the master branch.

So, to avoid this, you can follow the following steps:
1. Fetch the main branch that is the master branch.
2. Create a development branch.
3. From the development branch, create branches with the feature name that you want to work on.
4. Merge those branches with the development branch after they are tested.
5. Test the development branch for any errors and be absolutely sure it is stable before merging it with the master branch.

This is how I usually do stuff. Feel free to comment on how you guys tackle different GIT problems.

2 thoughts on “Best GIT practice when you are just starting up.”

Leave a Comment

Your email address will not be published. Required fields are marked *

Tweet
Share
Share
Pin