Git official documentation is very detailed, and there are many named lines, but there are not many commonly used command lines in the project. Here is a summary of the common command lines in the project. For git official documentation, go to →
Branch name
Common command lines
Create a branch
Create a branch called release-fix-user from release
Git checkout -b relex-fix-user origin/release git checkout -b relex-fix-user origin/releaseCopy the code
The temporary change
git add .
Copy the code
Commit staging area to local repository
Git commit -mCopy the code
Cancel this temporary change
Git reset --soft HEAD^ Save add git reset --hard HEAD^Copy the code
Commit to the remote repository
git push origin release-fix-user
Copy the code
Branch merge
git merge --squash release-fix-user
Copy the code
Branch force refresh
git remote prune origin
Copy the code
Delete the branch
Git branch -d release-fix-user git push origin --delete release-fix-user git branch -d release-fix-user git push origin --delete release-fix-userCopy the code
View all branches
git branch -a
Copy the code