Python Course Design Note 42 of 52

Mastering GitHub on Your Own

This article introduces GitHub and related topics, giving a complete description from its origins to practical use. I hope that after reading it you’ll never need to ask anyone for help with GitHub again. If there’s anything I haven’t covered, leave a comment at the bottom of the screen.

GitHub Basics

What Is GitHub?

Most engineers are probably no strangers to GitHub, but to take care of everyone, let’s do a quick introduction. GitHub is a code hosting platform, one of the repositories programmers use specifically to store code. Just as everyone uses Baidu Netdisk to store files, for programmers, being able to use GitHub proficiently is an essential skill.

Why Use GitHub?

Platforms like GitHub are actually more than just a repository for storing code; if that were all, we could simply store code on Baidu Netdisk. GitHub provides a feature called version control, or distributed control. Don’t panic: it’s really just a slightly smarter repository, but still a repository. We can easily control the repository’s data through code, and thereby carry out automated work such as testing, deployment and operations. If you don’t use GitHub, you can still use Gitee or Alibaba’s Code Cloud to get the job done; they’re used in almost exactly the same way (because they all grew out of the same monkey, and that monkey is git, whose usage will be explained in detail later), but GitHub’s user base far exceeds these platforms. Because GitHub is a platform for programmers, most of its users are male; if you’re gay, you’ll definitely fall in love with GitHub. So in the industry, GitHub is jokingly called GayHub (the international programmers’ dating platform).

GitHub’s Past

GitHub is a platform, and building it depended on the birth and development of Git, just as electric lights required the discovery of electricity first. In fact, with Git you could build a version control system of your own. So when we talk about GitHub’s past, we’re really talking about Git’s past. The person who invented Git is Linus Torvalds; almost every programmer knows that besides creating Linux, he also created the version control system Git.

Why did he develop Git? At the end of March 2005, the Linux kernel development community was facing a serious challenge: they could no longer use the version control software BitKeeper (because the copyright holder of BitKeeper decided to revoke the license at the time, and the kernel development team’s negotiations with them failed), and no other source code management (SCM) software met their needs. Linus Torvalds took up the challenge and decided to develop a new version control system. He disappeared for a weekend, and the following week Git was born. Today Git has become the version control system for tens of thousands of projects. In May 2007 (note the date; this isn’t recent news), Linus was a guest at Google Talk to introduce Git. In the talk, Linus explained his original motivation for developing Git, the flaws of CVS/SVN and the advantages of Git, and scolded a bunch of people along the way. The link below is the video.

https://v.qq.com/x/page/o0772kqh5iv.html

GitHub Today

To use GitHub, you first need to install the git command on your computer

Windows: https://gitforwindows.org/ Go to this website, download it and do a click-through install

MacOS: install it directly with the command brew install git

For basic git usage, see the video: link: https://pan.baidu.com/s/1x8RV0aOpImUkQApphcDdrA password: ut1g

More usage is shown below

Using git Commands

Creating and Configuring

Adding and Removing

Committing Code

Branch Control

Tag Management

Viewing Information

Remote Sync

Undo and Reset

Other