git config --global user.name "用户名"
git config --global user.email "邮箱"
ssh-keygen –t rsa –C“email”
git init
git add fileName // 增加指定文件到暂存区
git add . // 增加全副文件到暂存区
git commit -m“commitInfo”
git push
git status
git diff
git log
git log –pretty=oneline // 一行内显示
git reflog // 最后面的为 commit_id,用于回退到指定版本
git reset –hard HEAD^
git reset –hard“commit_id”
git branch branch_name
git branch
git switch branch_name
git merge branch_name
git log –-graph –pretty=oneline –abbrev-commit
git branch -d branch_name
git remote add origin“仓库地址”
git pull origin master
git clone url
git branch -r
git push origin branch_name // 后续若需将本地仓库内容提交也执行该命令
git push origin branch_name
git tag tag_name // tag_name 个别具备意义,如版本号 V2.0
git tag -a tag_name-m "message" commit_id // message 为标签阐明信息,如 version2.0 released
git tag
git log --pretty=oneline --abbrev-commit
git tag tag_name commit_id
git show tag_name