What is Git

Git is a free distributed version control system designed to handle everything from small to large projects quickly and efficiently

Regardless of software development or any industry, code and documentation are not written all at once. They need countless revisions and iterations of versions. Git is a good version management tool. If you are not satisfied, you can simply roll back to the version you want

What is making

Github is a project hosting platform that uses Git for version control, as well as a code cloud in China. Both are project-hosting platforms that use Git for version control and, in plain English, code repositories.

Github and code cloud in fact, there is no big difference in the use of functions, a significant difference, Github is the world’s largest code hosting warehouse, rich resources, in a word, is only you can’t think of, there is no he can’t do. The code resources are very rich, but for some inexplicable reason, the network speed is a bit slow, but it works. The code cloud is not so rich in resources, but fortunately it is a domestic code warehouse, relatively a little better speed.

Also, both offer free static web pages that can be accessed through specific, specific domains. There’s also a free feature that’s been around for a while, free private repositories, which used to cost money to build on Github

The difference between Git and Github

  • Git is an open source distributed version control system.
  • GitHub is essentially a code hosting platform that provides git-based code hosting services.
  • Even if a team doesn’t use GitHub, they can build and manage their own Git server to manage their code base. There are even other code hosts available, such as GitLab, BitBucket, etc. — from IBM

In short, Git is a method. GitHub is just a repository that uses this approach. There is only one method, and many others adopt it, such as Github, code Cloud, and Gitlab

The essence of Github is still using Git, and the methods are all Git methods, but transformed into a visual form of software

Git installation for Windows

Git’s homepage introduces the advantages of Git and what big companies are adopting it. Installation on Windows is actually very easy, just download the installation package. Download the.exe executable file, just double-click it, and then go on to the next step

After the installation is complete, verify whether the installation is successful. Go to the command line and type git –version. If you get feedback like the following, the installation is successful

How do I use Github

Simply put, Git is a “code management tool” that manages the history of your code

Here is a more general process record:

1. Create a public warehouse

Click New on the Github home page to create a public repository, which is the repository we already created

2. Copy other people’s Github files to your own Github fork

3. Clone someone else’s Github files to your own computer (local files)

4. Edit as much as you like

You can write directly in your Github file using the Web or client, or in a local file

5. Upload files

Give your submission a name next to your avatar, which will be handy if you look for it again. Then click Commit to Master and Sync in the upper right corner.

6. Get the latest file of someone else’s project [pull] [fetch + merge]

Fork someone else’s project to its own repository. When someone else’s project is updated, how do we update the fork project?

Method 1: Git pull

Method 2: Fetch + merge

Fetch online updates to its own project first, then judge, then merge (the difference with pull is that judgment is added. Direct pull is the same if you fully trust the update of the project)

7. Help others change projects

If you find an error in someone else’s project file, do it on your own Github

For example, if the owner of the warehouse (A) does not add us as A project partner, we clone A warehouse named “A” to our own computer and modify it on our own computer, but we will find that we cannot contribute the code to warehouse A through push

So to contribute your code to repository A, we should:

  1. In A’s warehouseforkProject A (at this point we have a similar repository on Githuba', but the URL is different.
  2. Will we modify the codepushGo to your github repositorya'
  3. pull request, the host will receive the request andDecide whether to take it or notAccept your code

8. Roll Back to this Commit

The client selects History, then clicks on the pinion and selects Roll Back to this Commit to return to the original version

How to use the code cloud

Here’s a vUE project on station B, covered in this video series

  • Item Initialization: Creates a code cloud account and configures an SSH public key
  • 06. Project initialization – Hosting the local project in the code cloud

Refer to the article

  • Git and Github differences and installation
  • How do I use GitHub? – Shan shan is a little sun answer – zhihu
  • The difference between fork and Clone on Github is pull request