A little knowledge about github

A little knowledge about github

GitHub is becoming more and more famous, and many students add it as a keyword to their resumes. However, in the interview, I asked how to use GitHub, and the other party usually replied: Go up and look at the source code! This answer is completely unsatisfactory to me. Next, I want to talk briefly about how I think I should use GitHub.

Issues and PR

A GitHub repository is more than just a source code. GitHub is a social platform for developers, so each project has two very important modules outside of the code:

  1. Issues, including bugs, and other features that users want
  2. Pull Requests (PR) Other developers have made some improvements on this project, or fixed some bugs, hoping to merge into the master, they will initiate a PR

There is no perfect code. The more people use the library, the more problems or problems may be discovered. Reading other people's questions, many times you can get a lot of gains. For example, what problems did you encounter during development? Is there anything similar to mine? How did they solve it? What new feature do you most want? What are worth paying attention to? what can I do? and so on.

And, perhaps more importantly, how we should communicate with the original author of the warehouse through Issues.

After all, each of us has limited time. For most open source libraries, understanding how to use, what are the problems, and how to avoid stepping on pits is usually more valuable than knowing how a certain function is written. .

See documentation

Good open source libraries usually have one place that is very well done, that is, their documentation, which is usually detailed and valuable. By reading the documentation, you can quickly understand what the warehouse is used for, how it should be used, what problems it can solve, and what its development direction is next.

According to my observation, documents are usually distributed in three places:

  1. README.md, which is to open the warehouse page, the default rendering is in the block below the file list
  2. The official website, usually under the navigation, there is the warehouse profile
  3. wiki, accessible via navigation links

Observe the frequency of submissions

Not all warehouses have developers actively developing and maintaining them. If you search for articles from a few years ago and are directed to some older warehouses, for some reason, no one has maintained it. At this time, you should give up and give up.

Life is short and time is limited, there will always be more valuable warehouses for us to learn.

GitHub hot trends

There is also a popular trend page on GitHub , from which you can learn which repositories developers all over the world are paying attention to. You can mark the ones you are interested in with stars, and look at its Issues from time to time in the future. , PR and documentation, usually have a lot of gains.

GitHub Pages

GitHub also provides us with a very good static website space, which is completely free, and there are CDNs all over the world. It is the legendary GitHub Pages.

We can use it to write blogs, take notes, and the point is that the content can be fully versioned.

Please Google for specific methods.

Don't give up submitting your own warehouse, and actively raise issues and initiate PR to other developers

I think this is the same thing as writing a blog. If you just take notes on paper and show it to yourself, you will probably not understand it; but if you think of blogging, someone will see it, so you will probably figure out what to write. Write comprehensively, logic is clear and self-consistent. So blogging is a better way to learn than taking notes. By analogy, pushing your own repository to GitHub should also be a better way to learn than practicing locally.

You are never encouraged to mess around here. On the contrary, I hope that you will be responsible for your actions and pay attention to Issue and PR. After all, they are all for other developers, which will affect others more or less. Therefore, before mentioning it, it is very necessary to read the instructions for submission of the warehouse owner, write the code in accordance with the other party's code specifications, write related tests, and then submit. Don’t draw cats indiscriminately.

summary

This article is not to teach you the application skills, but to share some of your own experience, so that everyone can learn the correct development skills through GitHub, the world's largest code hosting platform.

Reference: https://cloud.tencent.com/developer/article/1055521 A little knowledge about github-Cloud + Community-Tencent Cloud