Installation, use and uninstallation of Git on windows system

Git installation

Git official download

  1. Download as follows:insert image description here
  2. Double-click, install, keep clicking next, and the default installation is fine.
    After the installation is complete, right-click and see the picture below to indicate that the installation is successful
    insert image description here
  3. Set user name and email address, which is very important【[email protected]
  git config --global user.name "你的用户名"
  git config --global user.email "你的邮箱"
  1. Use the following command to check whether the setting is successful
  git config --list

Git uses

When using Git, make sure you have a registered Gittee account

Description: The copy key in git is Insert or Fn+Insert

One: Use ssh to clone the remote warehouse

  1. Log in to the Gitee account and create a remote warehouse
    insert image description here

  2. Fill in the warehouse name, leave the rest as default, and then click Create.
    insert image description here
    At this point, a remote warehouse has been built.

  3. Create a folder named GitDemo under D drive as Git's local repository

  4. Right-click in the [D:\GitDemo] directory and select [Git Bash Here] to bring up the command window

  5. Initialize the local warehouse

	//初始化本地仓库
	git init
  1. A [[.git] file will appear under the folder, indicating that the local warehouse has been initialized successfully
    insert image description here
  2. To establish an association with a remote warehouse, you need a private key and a public key. Execute the following command and press Enter all the time
//生成公钥和私钥     一直敲回车
ssh-keygen -t rsa

The result shown in the figure shows that the public key and private key are successfully generated
insert image description here

  1. View the public key and private key, location: navigation bar as shown below
    insert image description here
  2. Copy the content in the public key file, log in to the Gitee account, and configure the public key, as shown in the figure below:
    insert image description here
  3. Click OK, and you will be prompted to enter a password. After entering, the public key configuration is successful.
  4. Associate the local warehouse with the remote warehouse
/**
* 对下面的明林进行解析
* origin: 设置远程库的名字就是origin,这是Git默认的叫法,也 * 可以改成别的
* yfengwang:你自己Gitee上的用户名
* demo001.git 刚刚创建的仓库名称
**/
git remote add origin git@gitee.com:yfengwang/demo001.git
  1. Copy the newly created warehouse address, which is the address of ssh
    insert image description here

  2. Re-open the [Git Bash Here] command window, pay attention to the directory, remote clone

git clone 你的ssh仓库地址

insert image description here
Second, use HTTP to clone the remote warehouse

  1. Create a new Git_HTTPS folder on the D drive.
  2. Copy the HTTPS address of the remote warehouse
    insert image description here
  3. Right-click in the [D:\Git_HTTPS] directory, select [Git Bash Here] to bring up the command window, clone the remote warehouse, and ask you to enter the user name and password. As shown below
git clone 远程仓库HTTPS地址

The username and password are the username and password on gitee
insert image description here
4. After entering the username and password, the remote warehouse has been cloned, as shown in
insert image description here
the error situation

  1. If the username or password does not match, go to [Control Panel\User Accounts\Manage Windows Credentials] as shown below:
    insert image description here

Click Edit to change the username and password to be consistent with the gitee account

Then execute in the [Git Bash Here] command window

git config --system --unset credential.helper

Re-execute the clone command, you will be prompted to enter the user name and password, just re-enter

Git uninstall

  1. Find Uninstall in the computer, then find Git, click Uninstall
    insert image description here
  2. Follow the navigation bar below, find the Git configuration file, and delete
    insert image description here
  3. Follow the navigation bar below to delete the key
    insert image description here

Guess you like

Origin blog.csdn.net/packge/article/details/124882084
Recommended