Git common commands, quickly collect them!

1. Initialize a warehouse: git init
2. View branches: git branch
3. Add modified or untracked files to the temporary storage area: git add [file] or git add .
4. Submit to the local warehouse: git commit - m "Mention record xxxx"
5. Push the local branch to the remote branch: git push
6. View the status of the current working directory and temporary storage area: git status
7. View the submitted log records: git log
8. Pull from the remote branch Code: git pull
9. Merge a branch (xxx) into the current branch: git merge xxx
10. Switch to branch xxx: git checkout xxx
11. Create branch xxx and switch to it: git checkout -b xxx
12. Delete branch xxx : git branch -d xxx
13. Save the changes from the current branch to the stack: git stash
14. Restore the cached changes in the stack: git stash pop

Guess you like

Origin blog.csdn.net/hu_666666/article/details/132249016