Why are Git and GitHub so important?

Editor's note: As a data scientist, Git and GitHub must be familiar to everyone. Among them, Git is the best version control software, and GitHub is a code hosting library based on Git. Faced with such a wide range of tools, learning is naturally an endless process, but how can a novice develop a good habit from the beginning? For this question, Ariel Camus, the founder of Microverse, has something to say.

This article will not cover specific issues such as how to create a GitHub configuration file and how to push Git locally. On the contrary, we will first explain why it is important to use Git and GitHub, and then introduce three simple rules. As long as you develop a habit, you You can benefit from it endlessly.

Why are Git and GitHub so important?

If you are just starting to learn computer, then your goal afterwards may be to accumulate knowledge and get a counterpart job after graduation, such as software engineer, data scientist, etc. under these circumstances. The answer is simple-

It is important to learn how to use Git and GitHub, because the probability that you will frequently use them after work is almost 99%, and they have become standard equipment for all technology companies. So, if you want to stand out from junior developers, you'd better spend more snacks on Git and GitHub.

The "advanced" point of senior developers is not that they have a deeper understanding of the syntax of programming languages, but that they have more experience in actual complex large-scale projects.

And if you are just a newcomer, it is very difficult for you to get this kind of experience. Experience comes from life and comes from practice. Git and GitHub are just a good way for you to accumulate practical experience from actual projects.

Having said that, you may have agreed with the benefits of these tools for job hunting, so the remaining question is: Why are Git and GitHub so important to the company?

In short, Git is a tool that allows team members to efficiently and effectively submit development code for the same project in an asynchronous manner. As people can collaborate better, the problems the team can solve are naturally larger and more complex. This is a distributed version control system that provides mechanisms for reverting changes, creating code branches, and resolving code merge conflicts-these are very useful features that can help solve common problems that teams encounter every day.

For these problems, Git is currently the best solution.

On the other hand, GitHub is a software source code hosting service for version control through Git. It provides solutions for various specific problems and common problems, such as Code Review, pull reqeust, problem management/bug tracking, etc.

Note: Even though Git is the preferred version control tool for most companies, GitHub still has some powerful competitors, such as GitLab and Bitbucket. In fact, when GitHub was acquired by Microsoft before, a few developers had migrated their code bases, but GitHub is still the mainstream. If you are already proficient in how to use GitHub, you will find that using GitLab and Bitbucket will not feel uncomfortable.

Git and GitHub practical advice: three simple rules

Because I am the founder of Microverse, I will briefly mention my teaching experience here. Microverse is a remote training school for software engineers. When we teach students how to write code, we will also provide a lot of guidance and planning so that they can put what they have learned in the class into practice.

The first thing we ask students to do is to follow the following three simple rules and become professional users of Git and GitHub. But before proceeding in detail, please ask yourself the following two questions:

Are you familiar with Git and GitHub? If not, there is a tutorial on HubSpot that is worth reading.

Do you know what GitHub Flow is? If not, go to GitHub to read the official introduction.

Next is the focus of this section: three rules.

Rule 1: Create a Git repository for each new project.

Rule 2: Create a new branch for each new feature.

Rule 3: Use pull reqeust to merge the code into the Master branch.

Rule 1: Create a Git repository for each new project

The first rule is simple, but it is not easy to develop this habit. Whenever you start a new project-portfolio, learning project, competition solution, etc.-you should open a new Git repository and upload it to GitHub.

A dedicated repo is the first step in using version control for every line of code you write, and version control is how major companies work on actual projects. So learning this this morning and forming a habit will help you develop in the future.

Rule 2: Create a new branch for each new feature

Suppose you are developing a portfolio project (such as a stock and bond portfolio) and want to build a "contact us" component, then you should build a dedicated branch for this new feature and give it an intuitive and meaningful name (such as contact-me-section), and then store all the code related to this component in it.

If you don't know what a branch is, you can go to the GitHub Flow recommended to read before.

By branching, you can work on different functions in parallel with other team members, while keeping the specific code of each function isolated from other functions. This method helps to screen for unstable code and ensure the efficiency of the merged code.

Even if you are the only one in the team, developing this habit will help you straighten out your thinking and build an advantage in your future work.

Rule 3: Use pull reqeust to merge the code into the Master branch

By default, after the initial commit of the database, Git creates a branch called master. However, you should never add changes directly. Instead, you should use the feature branch mentioned above, then open a new pull reqeust and merge the feature branch code with the main branch code.

In actual work, some people may check your pull reqeust and conduct a code review without your knowledge. At the same time, GitHub will also do automated testing of your code, and then submit bug reminders to you. In other words, if there is a conflict between your code and the main branch code, it will report an error, and the error may not be caused by you. You will also be notified of changes submitted by other developers on the team.

You can only merge pull reqeust if you make sure that your code has been reviewed, tested, and approved, or the person in charge of the review will do it for you.

If you are the only one in this project, then you have to get used to it, because this is the basic workflow of almost every open source project. If you have participated in other people's projects, then practicing these three rules will also help you clarify your contribution.

Maybe after reading the above content, you are still a little confused, but now you can slowly remember and develop these three habits. Don't think about the "how" to do this. If you can always focus on the "what" and "why", you will find that the whole process will become extremely simple and natural.

Digital Signage

Digital Signage,Digital Screen Poster,Android Video Players,Digital Signage Display Screen

APIO ELECTRONIC CO.,LTD , https://www.apiodisplays.com

Posted on