How to learn open source projects + social on Git Hub

background

As a professional open source website, Git Hub implements various functions based on the version control software Git. It is a paradise for programmers to exchange experience and learn open source projects.

However, due to the large differences in learning methods and programming thinking at home and abroad, many people in the country are still puzzled by the use of Git Hub. Most people still don't understand how to find open source projects that meet their needs from Git Hub and read and learn, how to contribute to other people's projects, and how to communicate with other programmers.

The author has also experienced a long period of confusion, and now I dare to write some personal experiences to help everyone avoid detours.

Precondition

  • Know basic Git commands, make commands
  • Linux/Unix system is installed, Mac should also work
  • Will use basic bash commands
  • Have your own Git Hub account

@The above is just a suggestion, I can't imitate it! _


Search for open source projects of the corresponding topic

step

  1. Open the browser, enter the URL to https://github.com/open Git Hub ;

  2. Log in to your personal Git Hub account;

  3. Click the Explorebutton at the top of the website's homepage ;
    Insert picture description here

  4. Enter the subject you want to find in the exploration field on the upper left, such as C++;
    Insert picture description here

  5. Select the type and language in the search results menu bar on the left side of the page, such as Repositories+ C++;

  6. Select the filter criteria above the search results on the right side of the page, such as Fewest stars(The author's level is too low, start with the simplest project);
    Insert picture description here

  7. Click on the item you want to view, such as cppworkshop(this seems to be a programming homework assigned to students by a foreign teacher);
    Insert picture description here

  8. Read the README.mddocumentation below the project to understand the project overview written by the author;
    Insert picture description here

  9. Search for the item you want according to this method.

Download the project source code from Git Hub and compile and execute

We have found the project we want before, and now we can get the source code of the project, compile and run the project on the local computer.

step

  1. Click the Clone or downloadbutton at the top right of the root directory of the Git Hub project (note! The button will only be displayed in the root directory);
    Insert picture description here

  2. In the small form that pops up, click https://github.com/apmanol/cppworkshop.gitthe button on the right side of the URL bar (eg ) to copy the URL;

  3. Open the terminal window of the Linux system (input command line window);
    Insert picture description here

  4. Enter the git command to pull the project from Git Hub;

  5. Enter the directory of the local project, check the README.mddocuments in the root directory, and understand the project overview, which may include important instructions for compiling and executing operations;

  6. Perform the compilation operation according to the instructions;

    cd cppworkshop/
    make distclean
    make debug=1
    
  7. execute project;

    ./bin/memerr
    

Insert picture description here
8. In-depth study of the project, such as reading the source code, modifying the source code, etc.
Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here

Fork other people's projects and apply for Pull Request

Sometimes, we not only want to view other people's projects, but also want to join the project development, but due to the lack of relevant permissions, we can only Fork the project as an outsider, modify it locally, submit it to the personal warehouse, and then apply to the original author for Pull Request.

step

  1. Search for projects you are interested in on Git Hub;

  2. Click the Forkbutton in the upper right corner of the project to add the project to the personal warehouse;
    Insert picture description here

  3. On the local computer, use the operations mentioned above to pull the project from the Fork from the personal warehouse (note! It is your own Git Hub URL, not the original author's project URL, the name is different);

    git clone https://github.com/gkzscs/cppworkshop.git
    

Insert picture description here
4. Make project modifications locally;

  1. Use the Git command to submit the modification to your Git Hub warehouse, and add a comment on the modification content;

    git add <files>
    git commit
    git push
    
  2. On the Git Hub webpage, enter the project directory from your Fork and create a Pull Request (more cumbersome);
    Insert picture description here

  3. Waiting for the original author's confirmation (can meet but not ask).

Git Hub social

In fact, Git Hub provides simple social functions, it is not just an open source project repository.

You can exchange emails with other programmers, follow each other, fork each other, learn together, become friends...

step

  1. Open the home page of the Git Hub website;

  2. Click the Explorebutton in the top menu bar ;

  3. Enter the user name you want to search in the search bar on the left, such as Chen;

  4. Select from the type on the left side of the search result Users, that is, user;

  5. You can click the filter button on the upper right to Sortselect filter conditions, such as Fewest followers;
    Insert picture description here

  6. Select the user you want to view from the search results and click its name, such as CJ.Chen;
    Insert picture description here

  7. Click the Followbutton below the user's avatar , similar to the follow function;

  8. There are also contact information such as address and email below the user, you can try;

  9. You can view it in your personal information Following, and you will be able to receive dynamic messages from people you follow on your personal homepage in the future.
    Insert picture description here


about me

I am an innovative and optimistic teenager whose
hobbies are reading, playing football, playing LOL, etc.
Friends who like my articles can add a personal WeChat: CS-huo
if you have any questions, you can discuss with each other and learn together!

Guess you like

Origin blog.csdn.net/gkzscs/article/details/103582277