Set global variables, user names

git config --global user.name "tang"
Copy the code

Set global variables, mailbox

git config --global user.email "[email protected]"
Copy the code

Check the status

git status
Copy the code

Add all files to the staging area

git add -a
Copy the code

Add all files to staging area, excluding deleting files

git add .
Copy the code

Submit temporary storage area to warehouse area

git commit -m ""
Copy the code

Commit to staging area and submit to branch

git commit -am ""
Copy the code

Retrieve the changes from the remote repository and merge them with the local branch

git pull
Copy the code

Submit the warehouse code to the remote repository

git push
Copy the code

View all branches

git branch -a
Copy the code

Switch to the specified branch and update the workspace

git checkout dev
Copy the code

Create a local branch x and automatically cut the local branch X

git checkout -b develop
Copy the code

Push the new local branch to remote

git push origin develop
Copy the code

Delete the local branch by checking out to another branch

git branch -d develop
Copy the code

Deleting a Remote Branch

git push origin --delete develop
Copy the code

Merges the specified branch into the current branch

git merge master
Copy the code

Displays the version history of the current branch

git log
Copy the code