GIT commands

Insert picture description here
GIT configuration
View configuration
git config -l
set user name and mailbox
Command
git config --global user.name "name"
git config --global user.email mailbox
view system config
git config --system --list
view current user
git config --list --global
gIT local area there are three working
working directory, staging area, resource library, if coupled with a remote git repository can be divided into four areas, which converts files between these four areas
● Workspace: Workspace, which is where you usually store the project
codeIndex/ Stage: Temporary storage area, used to temporarily store your changes. In fact, it is just a file that saves the information that will be submitted to the file
listRepository: Warehouse area ( (Or local warehouse), is the safe place to store data, which contains the data you submit to all versions. Among them, HEAD points to the latest
version put into the warehouse.Remote
: remote warehouse, the server hosting the code, can be simply regarded as a computer in your project group for remote data exchange
. The three local areas should be git warehouses. The version pointed to by the middle HEAD:
simple workflow
1, add and modify files in the working directory
2, put the files that need version management into the temporary storage area
3, and submit the files in the temporary storage area to git
Therefore, the files managed by git have three states: modified (modified), staged (staged), committed (committed)
View the file status
git status File name
View the
status of
all files
git status Add all files git add.
Submit temporary Save the contents of the area to the local -m Submit information
git commit -m
Set the machine to bind the SSH public key to realize password
- free login ssh-keygen
Common commands in the git branch:
#List all local branches
git branch #List
all remote branches
git branch -r #Create a
new branch, but still stay on the current branch
git branch [branch-name]
#Create a new branch and switch to this branch
git checkout -b [branch] #Merge the
specified branch to the current branch
$ git merge [ branch] #Delete
branch
$ git branch -d [branch-name] #Delete
remote branch
$ git push origin --delete [branch-name]
$ git branch -dr [remote/branch]

git push Submit to the remote,
if you need to enter the account password, modify
Insert picture description here

Guess you like

Origin blog.csdn.net/m0_46937429/article/details/112303844