All you need to know about Git

A simple git tutorial for you to master version control system!

Measure Space
2 min readOct 20, 2020

Git is a version control system. Using git, you can trace your code change history and better collaborate with others.

Git workflow introduction

When working with git, it’s always safe to have your own branch and do your personal work within it simply because the main branch may connect to the production system directly and you don’t want some small bugs to affect all your users. After everything is tested, you can merge your own branch with the main branch.

The following picture shows the basic workflow of using git. In your local desktop, typically you need to create two branches — one is the local main branch and the other one is the local feature branch. After your have a new feature developed, you may want to push the feature branch to remote repo and create a pull request to merge the remote feature branch with the remote main branch.

Basic usage

Here is an example of how to do that.

Merge feature branch with latest main branch

Another situation is that when you were working on your branch, your colleagues have already finished their part and committed new changes to the main branch. To make sure your working branch contains the latest code from main branch, a typical practice is to first update your local main branch and then merge your main branch with your local feature branch.

YouTube tutorial

Click the following image, and it will take you to YouTube for more detailed tutorial.

More tutorials and articles can be found at my blog-Measure Space and my YouTube channel.

References:

--

--

No responses yet