Brush a line on a certain topic about GitHub Message , as follows ：
There are still a lot of people like it , This shows that there are many engineering students who can't use GitHub, You see, there is no distinction between case and case （ Manual formation ）. So I want to write an article on science popularization ,“ How novices use GitHub？”
01、GitHub What is it?
Wikipedia defines it this way ：
GitHub It's through Git Software source code hosting service platform for version control , from GitHub The company's developers Chris Wanstrath、PJ Hyett and Tom Preston-Werner Use Ruby on Rails Written .
that Git And what is it ？
Let's look at the definition of Wikipedia ：
Git Is a distributed version control software , Originally by Linus · Created by Torvalds , On 2005 In the past years GPL In the form of an agreement , The initial goal is to better manage Linux Kernel development .
In short, it's ,Git Is a command line tool , A distributed version control system . It can silently help you manage and track historical versions of your code , It's like a time machine , So you don't have to be at a loss when the code goes wrong , Quickly back to the previous historical version .
Want to know more Git Knowledge of , You can click this link to jump to ：
Many beginners mistook Git Namely GitHub, But it's not .GitHub It's a code hosting site , It's just behind the back Git As a version management tool . The main service is to host your project code to the cloud server , Not on the local hard disk . There are similar websites gitlab.com and gitee.com（ Domestic version , The Chinese name is code cloud ）.
02、GitHub What can be done
Do whatever you want.
The answer above is one of the founders Chris Wanstrath Yes , I can't argue that .
1） Managed code
GitHub Your code will be modified automatically , When necessary , Can help you quickly go back to the previous historical version .
2） Search for open source projects
GitHub It's a gathering place for the world's top developers , Here you can find almost anything you want . There's a lot of excellence in it 、 Famous open source project , In compliance with its License Under the premise of , You can use it for free 、 Download these open source projects . This is also GitHub The most attractive place .
You can check out the following website GitHub On TOP 200 High quality open source project ：
You can publish your own open source projects to GitHub On the website , The more popular the project gets Star The higher the , It shows that the more the industry recognizes your ability . A good GitHub Home page , I can polish my resume a lot .
My two favorite practical projects （ I've recommended it countless times ）, From my good friend Jiangnan a little rain and macrozheng.
I'm going to write a 《 Teach girls Java》 The column , Need a repository to store code , How to do it? ？
open GitHub The desktop version , choice 「File」→「New Repository」. Then fill in the warehouse name 、 brief introduction , Select the local path for storage in the warehouse , I can click 「Create Repository」 Created a new project .
After creation , You can see the repository on the web side .
（ Why , How can you just create it star 了 ？）
If you're wandering GitHub When , Found some good projects , Want it for yourself , That would be very convenient , Just one fork You can get .
What shall I do? ？fork it , And then you can recreate it Java edition , And translate according to my style .
07、 Clone the project locally
GitHub One of the benefits , It keeps projects in the cloud , When you need it , Just clone it locally .
open GitHub The desktop version , choice 「File」→「Clone Repository」. You can clone the project under your account directly , Including what you created 、fork Of 、star Of .
It is recommended that you install Sublime Text, A text editor with very high appearance value , After successful installation ,GitHub The desktop version automatically uses it to associate items by default .
After opening , That's true （ See the picture below ）, Have to say , The beauty is really high .
Edit a paragraph and save it , Can be in GitHub The desktop version sees the changed files .
Fill in the changed description of the file and click 「Commit to master」（GitHub from 10 From this month on master Renamed main） Button submitted .
Click on 「Push origin」 It can be synchronized to GitHub Cloud warehouse .
09、 Back to the historical version
If you accidentally submit it wrong , What shall I do? ？
Click on 「History」 panel , Find the historical version you want to go back to , The right choice 「Revert this Commit」.
Click again on the 「Push origin」 That's all right. .
10、 Sync the cloud
GitHub You can collaborate with many people , If the local wants to keep up with the cloud , Can be in GitHub On the desktop version, click 「Fetch origin」
If you find something different between local and cloud , I can click 「Pull origin」 Pull from the cloud .
11、 Still want to advance
Through these basic operations , I think you will use GitHub 了 .
Anyway, it's an introduction , Don't worry about issue ah 、pr ah 、wiki ah , Being able to get feedback quickly through actual combat is so important for learning a new skill . Just get in the door , With confidence , You will fall in love with GitHub Of .
If you're not satisfied with the status quo , I want to go further , You can go to GitHub The official studies according to the course .