Git 常用命令参考手册
Set the global config
git config --global user.name "[name]"
git config --global user.email "[email]"Create a git repository
git initClone an existing git repository
git clone [url]Commit all tracked changes
git commit -am "[commit message]"Add new modifications to the last commit
git commit --amend --no-editChange last commit message
git commit --amendUndo most recent commit and keep changes
git reset HEAD~1Undo the N most recent commit and keep changes
git reset HEAD~NUndo most recent commit and get rid of changes
git reset HEAD~1 --hardReset branch to remote state
git fetch origin
git reset --hard origin/[branch-name]Renaming the local master branch to main
git branch -m master main