常用命令
clone
git clone <url>
remote
git remote add upstream <url>
git remote -v
fetch
git fetch upstream
git fetch upstream <分支名>
checkout
git checkout -b develop origin/<分支名>
git checkout -b develop upstream/<分支名>
merge
git merge upstream/<分支名>
pull
git pull upstream <分支名>
add
git add <文件>
commit
git commit -m <提交格式>
git commit --amend
push
git push origin <分支名>
git push origin --delete <需要删除的分支>
git push origin <branch-name> --force
branch
git branch -d <需要删除的分支>
git branch -a
git branch -r
status
git status
git status -s
diff
git diff <文件名>
config
git config --global user.email "xxx@yyy.com"
git config --global user.name "xxx"
log
git log
reset
git reset --soft HEAD~1
git reset --hard HEAD~1
git reset --hard <commit-hash>
git reset --hard <commit-hash>