Git Bash (command line) manual

Git Bash (command line) manual

illustrate

This manual only introduces basic Git commands.

In actual development, the Git plug-in in the IDE is generally used to directly complete the version management function.

Visual version control is recommended VSCodefor management. Please refer to:
"Git - VSCode User Manual"

Clone repository

Select the directory where the warehouse is downloaded

Select the directory where the repository is downloaded. for example:

E:\test

Inside this directory, 右键select Git Bash Here, to open the Git Bash command line.

insert image description here

clone command

git clone 仓库地址

for example:

git clone http://127.0.0.1:8080/songguanxun/HelloWorld.git

Get warehouse address

The warehouse address can be obtained from the Git server warehouse. Use HTTPtype address (default).

insert image description here

command effect

insert image description here

insert image description here

Warehouse folder display

The warehouse is downloaded to the local
insert image description here


check status

git status

insert image description here


Pull

Pull the latest version from the remote repository

git pull

Add file to cache

Add the specified file to the stage

git add <文件名>

Add all files to stage

git add .

Submit the code to the local warehouse

Submit the cache file to the local version warehouse

git commit -m "说明信息"

to push

Push to remote warehouse

push current branch

git push

Common Git commands

Please refer to: "Git Common Commands"

Guess you like

Origin blog.csdn.net/sgx1825192/article/details/129127852