You can understand a teamwork process through Git using my example.
Note: If you do not have basic knowledge of git and do not understand what this article says, please review the previous articles about your git.
Example: You are assigned to fix bugs iss53 for a company project and another person fixes another bug in the project. So how can two people code together quickly and conveniently?
To make it easy to understand, I will specify the names of the two people are A and B.
When A fixes bugs iss53, according to the process A will have to create a new branch.
Now the main branch of the company looks like this:
Person A does something and makes a commit on the iss53 branch.
Somewhere else, Person B does the same thing that Person A did to create a new branch named hotfix and do something and then create a commit on the hotfix branch.
After thoroughly checking their patches, person B decided to merge the hotfix branch with the company’s main branch by running the git merge command and then using git push to push it onto the git server of the company.
Now the main branch of your company will look like this:
Once the merge is complete, you can delete that branch because it’s not important right now.
Now go back to person A, because person B has done their work and has pushed it onto the company’s git server so person A needs to use git pull to pull the code back:
Then move on to the iss53 branch and use the git rebase command to merge the master branch into the iss53 branch and continue the work and make another commit on the iss53 branch:
Suppose that person A decides that the work on iss53 branch is completed. Person A will checkout the master branch and use the git rebase command to merge the iss53 branch with the master branch:
And finally delete the iss53 branch:
Finally, push the code to the company’s git server:
Good. So you’ve learned how to work in groups with others.Keywords: Git