Git learning first lesson

What is Git?

Git is the most advanced distributed version control system in the world.

The origin and tutorial of GIt can refer to the homepage of the Great God (https://www.liaoxuefeng.com/). I use the Great God's article as a teaching material. Tribute to God, thank you for sharing.

1. Centralized version management and distributed version management

    Centralized version management : One version server, multiple version user clients, and conflicts may arise when multiple people modify a code at the same time.

Distributed version management : Each version user is a version server. When multiple people modify a code at the same time, they only need to push their modified code to each other.

2. Git installation

I now mainly study under windows and linux .

Linux installation:

Make sure it is not installed first :

$ git

The program 'git' is currently not installed. You can install it by typing:

sudo apt-get install git

 

 Confirm that Ubuntu without Git is installed directly with the command: sudo apt-get install git

Other Linux versions : can be installed directly from source. First download the source code from the Git official website (https://git-scm.com/download) , then unzip it, and enter: ./config , make , sudo make install these commands to install it.

Windows installation (from the homepage of Liao Xuefeng):

Install Git on Windows

To use Git on Windows, you can download the installer directly from the Git official website (for students with slow internet speeds, please move to the domestic mirror ), and then install it according to the default options.

After the installation is complete, find "Git" -> "Git Bash" in the start menu, and a similar command line window pops up, indicating that the Git installation is successful!

 

After the installation is complete, you need to set the last step, enter at the command line:

$ git config --global user.name "Your Name"$ git config --global user.email "[email protected]"

Because Git is a distributed version control system, every machine must report itself: your name and email address. You might be worried, what if someone deliberately impersonates someone else? There is no need to worry about this. First of all, we believe that everyone is a kind and ignorant masses. Second, there are ways to check if there are people who are pretending to be.

Pay attention to the --global parameter of the git config command . Using this parameter means that all Git repositories on your machine will use this configuration. Of course, you can also specify different usernames and email addresses for a certain repository.

PS: You can see farther by standing on the shoulders of giants. Thanks again to the giants.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324643253&siteId=291194637