编程知识 cdmana.com

What else do you use, GIT

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 :

https://git-scm.com/book/zh/v2/%E8%B5%B7%E6%AD%A5-Git-%E6%98%AF%E4%BB%80%E4%B9%88%EF%BC%9F

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 :

https://www.githubs.cn/top

Among them, I recommended to you some time ago GitHub On the most inspirational computer self-study course

Chinese version offline PDF The download address is as follows :

https://pan.baidu.com/s/1tOyMq3sGa2-xuajGJJYwOQ, Extraction code :om0i

Search for quality projects , You may need some skill :

https://juejin.im/post/6891056415440535565

You may also need some methods :

https://www.zhihu.com/question/20084458/answer/1368411995

3) Use GitHub Pages Build a free blog site

GitHub Pages Provide static web hosting service , It comes directly from GitHub On the warehouse to get HTML、CSS and JavaScript file , Then build and publish the site .

coordination Jekyll、Hexo、Hugo、Pelican、Gridea Third party static template system can quickly build a beautiful blog website . For example, my personal blog uses Jekyll, The address is as follows :

http://www.itwanger.com

4) Study , Improve ability

GitHub There are too many quality tutorial resources , As long as you're willing to dig . The resources listed below are all good .

https://www.githubs.cn/awesome

For example, interview and writing questions :

Here's a list of some great books :

https://github.com/itwanger/JavaBooks

5) Enhance influence

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.

Micro personnel (19.2k star) The address of :

https://github.com/lenve/vhr

Electricity supplier system (43.1k star) The address of :

https://github.com/macrozheng/mall

When you see so much star Project , And it's a really good project , Do you admire their authors , To be honest , I'm both their friend and their fan .

6) other

  • Picture bed , Simply put GitHub Make a network disk .
  • BBS, Simply make friends, interact, chat and force .
  • translate , Ali's friends used to use GitHub Rewrite a Book 《Java Concurrent programming 》, Online access address :

https://github.com/RedSpider1/concurrent

Offline version of PDF Download address :

https://pan.baidu.com/s/11Z-IfAPEZNFWp_mAtqDIKw, Extraction code :drjx

03、 register GitHub account number

Said so much GitHub The benefits of , What are we waiting for? , Go and sign up for one GitHub Account number !

https://github.com/join

One GitHub Account number can be used as a business card for making friends , Of course, it can also be used to login some English learning websites , for instance GeeksforGeeks

04、 download GitHub The desktop version

Of course, you can go directly to GitHub Operate on the web , however , For starters , One GitHub The desktop version is more convenient 、 More straightforward 、 More stupid .

https://desktop.github.com/

05、 Create a new project

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 了 ?)

06、fork project

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 .

the other day , I found an interesting project :state-of-the-art-shitcode, Chinese translation Garbage code writing guidelines . however , The code example is to use JavaScript Compiling , And the Chinese translation is very bad .

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 can also be done through URL To clone in the form of , Now , You can also specify Projects on the code cloud Cloning .

08、 Editing project

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 .

https://lab.github.com/

besides , I'd like to recommend you a good introductory book 《GitHub Introduction and practice 》:

It's not easy to code words , I hope you like , If it can help you a little bit , That would be great !

A warm reminder , Remember to let it hide in the favorites to eat ash , Sideband Point a praise That's better. !

版权声明
本文为[Silent king two]所创,转载请带上原文链接,感谢

Tags use git
Scroll to Top