Learn about Git and GitHub

foreword

The author recently learned the use of git and github at station b, and felt a lot after learning. Come to station c to share.

1. The difference between git and github

First of all, Git is a distributed version control software. It is a version management tool that can only be used locally when your computer is not connected to the Internet. Its function is to allow you to better manage your program. Although the content that has been modified will be modified in the future, through the tool of git, you can reproduce the content you originally submitted, so that you can restore some wrong changes that you realized later.

Regarding github, this is a website, which is a program written by each programmer. You can build an online warehouse on github. Every time you submit your code, you can submit the code to the Internet, so that every time you submit, others will Everyone can see your code, and others can help you modify your code. This open source method is very convenient for communication and learning between programmers

And github is a very suitable website for programmers to communicate. Many international technology experts have their own open source codes on github. Others can freely see the programs written by these experts as long as they apply for an account. At the same time, many domestic Internet companies such as Baidu, Ali, etc., also publish open source codes on github, and interested programmers can also search for some by themselves. If you want to see the codes of major domestic companies, you can see the link: https://www.zhihu.com/question/20194937

2. Use git and GitHub for collaborative development

This is my biggest gain from learning git, using git for collaborative development. This really opened up a new world for me. This kind of development method is very common in more formal Internet companies. It is called gitflow workflow. Its working mode is as shown in the figure below.
insert image description here
Friends who have not watched the original video may not understand this picture. Let me explain it roughly.
First of all, the project leader must first write an original version v1. This version is mainly to write the framework of this project, so as to facilitate the distribution of tasks to the following people. The branch where this version is located belongs to the main branch, generally called master. This branch is only used to store stable versions, not unstable or undeveloped versions. Then the leader also creates a dev (development) branch, which is mainly used to continue to develop new functions for the younger brother. After all these are done, the leader will push it to GitHub, and the younger brothers can clone this project from GitHub to their own local. After cloning, build the branch that you need to develop functions on the dev branch, such as the Doudizhu branch in the figure. After the younger brother has developed this function, he will submit a review application, and the leader will see the younger brother's pull on GitHub. request, and then conduct a code review on it. After passing the review, you can merge the Doudizhu branch into the dev branch. After merging, a new release (release version) branch is also created. This is mainly used to test whether there are bugs. If there are bugs, a new bug branch is created. After the bug is fixed, it is merged into the release branch. A more stable version is available, and it can be merged into the master branch at this time.
After the other younger brothers have developed the functions, they also need the same process, so I won't go into details here.

This development model feels very useful and is not limited to the field of code. The author thought of the previous digital-analog competitions that I participated in. If I could also use Git at that time, the writing efficiency would definitely double, and I would definitely not need to stay overnight. It is only necessary for the team leader to write the overall framework of the thesis, upload it to GitHub, and then write according to this development model, which is absolutely efficient.

The principles are well understood, but the author now lacks a small partner who can also Git to collaborate with me on development. Ahhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh.

Summarize

Some other points mentioned in the original Git video are also very interesting, such as how to contribute code to open source projects on GitHub. I won’t go into details here. Interested friends can watch the original video by themselves.
Here is a link to the author’s learning video , as well as a link to class notes
: https://pan.baidu.com/s/1oeINbPmt8KQpCFw-2BrSzA
Extraction code: 2237
After copying this content, open the Baidu Netdisk mobile app, which is more convenient to operate – Sharing from Baidu Netdisk Super Member V5

Digression

It was the first time I found out that Q was so possessive. I thought she would be a more rational girl in the future, but not very possessive. Now it seems that I was wrong. But I still like her a lot hahahahaha.
The new look of q is unlocked plus one, and today I have to write a few more lines of code to celebrate hahahahahaha.

Guess you like

Origin blog.csdn.net/bookshu6/article/details/113496512
Recommended