A message about GitHub appeared on a website like this:
There are quite a few “likes” on GitHub, which shows that there are quite a few engineering students who don’t know how to use GitHub. So I decided to write an article on how to use GitHub for beginners.
What is GitHub
Wikipedia defines it this way:
GitHub is a software source code hosting platform for Git versioning. It was written by GitHub developers Chris Wanstrath, PJ Hyett, and Tom Preston-Werner in Ruby on Rails.
What is Git?
Let’s look at wikipedia’s definition:
Git is a distributed version control software originally created by Linus Torvalds and released under the GPL in 2005. It was originally intended to better manage Linux kernel development.
To put it simply, Git is a command line tool, a distributed version control system. It silently manages and tracks the history of your code behind the scenes, acting like a time machine that allows you to quickly revert to previous versions of your code if it goes wrong.
To learn more about Git, click this link:
Git-scm.com/book/zh/v2/…
Many beginners mistakenly think Git is GitHub, but it isn’t. GitHub is a code hosting site that uses Git as a version management tool behind it. The main service is to host your project code on a cloud server rather than a local hard drive. Similar sites include Gitlab.com and Gitee.com (the Domestic version, known in Chinese as Miyun).
02. What can GitHub do
Do whatever you want.
The answer is from co-founder Chris Wanstrath, and I can’t argue with that.
1) Managed code
GitHub will automatically log code changes for you, allowing you to quickly roll back to previous versions if necessary.
2) Search open source projects
GitHub is home to the world’s top developers, where you can find almost anything you want. There are many excellent and well-known open source projects that you can use and download for free as long as you comply with their licenses. This is the main attraction of GitHub.
Check out GitHub’s TOP 200 quality open source projects at this url:
www.githubs.cn/top
Here are some of GitHub’s most inspiring computer self-study tutorials I recommended a while back:
The download address for offline PDF of Chinese version is as follows:
Pan.baidu.com/s/1tOyMq3sG… , extraction code: OM0I
Here are some tips you may need to search for quality projects:
Juejin. Cn/post / 689105…
You may also need some methods:
www.zhihu.com/question/20…
3) Build a free blog site using GitHub Pages
GitHub Pages, a static web hosting service, takes HTML, CSS, and JavaScript files directly from a repository on GitHub and builds and publishes websites.
With third-party static templatingsystems such as Jekyll, Hexo, Hugo, Pelican, Gridea, etc., you can quickly build a beautiful blog site. For example, I use Jekyll for my personal blog and visit the following address:
www.itwanger.com
4) Study and improve your ability
GitHub is chock full of great tutorial resources if you’re willing to dig around. The resources listed below are all good.
www.githubs.cn/awesome
For example, interview and brushing:
Here’s a list of some great books:
Github.com/itwanger/Ja…
5) Increase your influence
You can post your open source project on GitHub, and the more popular the project, the higher the Star rating, indicating that the industry thinks you are competent. A great GitHub homepage can be a great way to polish your resume.
Two of my favorite actual combat projects (recommended countless times) are from my good friend Jiangnan Little Rain and Macrozheng.
(19.2K STAR)
github.com/lenve/vhr
E-commerce System (43.1K STAR) address:
Github.com/macrozheng/…
When you see so many star projects, which are really worthy of the name, do you admire their authors? To be honest, I am both their friend and their fan.
6) other
- Map bed, simply make GitHub a web disk.
- BBS, simply make friends interactive chat blowing force.
- GitHub has been used to rewrite a book “Java Concurrent Programming”, online access to address:
Github.com/RedSpider1/…
Download PDF for offline version:
Pan.baidu.com/s/11Z-IfAPE… , extraction code: DRJX
03. Create a GitHub account
What are you waiting for? Sign up for a GitHub account!
github.com/join
A GitHub account can also be used to log in to English learning sites, such as GeeksforGeeks:
04. Download GitHub for desktop
You can do it directly from the GitHub web page, of course, but a GitHub desktop version is much more convenient, straightforward and goofy for beginners.
desktop.github.com/
Create a new project
I need a repository to store my code for my Java column. How do I do that?
Open the GitHub desktop and select “File” → “New Repository”. Then fill in the Repository name, profile, and select a local Repository location to Create a new project by clicking “Create Repository”.
After the repository is created, you can view it on the web page.
(Oh, how did you just create a star?)
06. Fork Project
If you’re browsing GitHub and come across some cool projects that you want to keep for yourself, it’s so easy that you can just fork them out.
I found an interesting project the other day: state-of-the-art-shitcode. However, the code examples are written in JavaScript and poorly translated into Chinese.
What to do? Fork it, then you can remake it in Java and translate it my way.
07. Clone the project locally
One of the nice things about GitHub is that it keeps projects in the cloud so you can clone them locally when you need them.
On GitHub desktop, choose File > Clone Repository. You can clone all the projects under your account, including the ones you created, fork, and star.
You can also clone in the form of a URL. In this case, you can also specify an item on the code cloud for cloning.
08. Edit projects
It is recommended that you install Sublime Text, a highly presentable Text editor, on your computer, and GitHub desktop automatically uses it to associate projects by default.
When opened, it looks like this (see picture below) and I have to say, the level of appearance is really high.
Edit a text and save it. You can see the changed file on GitHub desktop.
Fill in the description of the changes to the file and you can click the “Commit to Master” button. (GitHub has changed its name from Master to Main since October.)
Click “Push Origin” to sync to the GitHub repository.
09, Rollback to historical version
What if you accidentally make a mistake?
Click on the “History” panel to find the History version you want to Revert to, right-click and select “Revert This Commit.”
Click “Push Origin” again.
10. Sync with the cloud
GitHub can collaborate with multiple people. If you want to synchronize with the cloud locally, you can click “Fetch Origin” on GitHub Desktop.
If you find a difference between the local and the cloud, you can click “Pull Origin” to Pull it from the cloud.
Also want to advance
With these basic steps, I’m sure you’ll be using GitHub.
Getting feedback quickly through the field is an important part of learning a new skill, regardless of issues, PR, or wiki. Once you get in the door and have confidence, you’ll love GitHub.
If you’re not satisfied with the status quo and want to take it one step further, you can go to GitHub and follow the course.
lab.github.com/
In addition, I recommend a good introduction to GitHub introduction and Practice:
Code word is not easy, I hope you can like it, if you can play a little help, that would be great! Make sure to put it in the dust, and even better, give it a like!