The use of git in Linux

1. Pre-requirements

1.git installation

insert image description here

2. Register Gitee and create a warehouse

insert image description here

Then remember the URL below.

insert image description here

Then clone the warehouse to the cloud server. Remember to enter the gitee account and password.

insert image description here

Check the directory, you can find that the warehouse is already in the directory.

insert image description here

Enter the directory, and the .git inside is the local warehouse.

insert image description here

Two. git three tricks

First we need to clone the file we want to upload into testing-warehouse-testing.

insert image description here

first strike

First use git add to add the files in this directory to the cache.

insert image description here

second ax

Then use git commit to submit to the local. Note that the submission log must be written here, and it cannot be written indiscriminately, so that it can be viewed later. Here you can use git status to see if there are files that need git commit.

insert image description here

If you are installing Git for the first time, it will ask you to fill in the information. Configure email and username.

insert image description here

Just run both commands. After the configuration is complete, it can be submitted normally.

insert image description here

The third ax

Use git push to synchronize the local warehouse with the remote warehouse.

insert image description here

The first push also encountered a problem, just execute the following line of code.

insert image description here

This completes the basic operation of git.

insert image description here

Guess you like

Origin blog.csdn.net/m0_73790767/article/details/131576651