设置用户信息
git config --global user.name "xx"
git config --global user.email "xxx@xx"
查看配置信息
git config --list
查看文件状态
git status
将文件的修改加入暂存区
git add
将暂存区的文件取消暂存或者是切换到指定版本
git reset
git reset --hard xxx
将暂存区的文件修改提交到版本库
git commit
查看日志
git log
增加远程仓库
git remote
git remote add origin xxxx
拉取远程仓库报错
fatal :refusing to merge unrelated histories
合并:git pull --allow-unrelated-histories
推送
git push origin master(xxx)
查看分支
git branch
创建分支
git branch [name]
切换分支
git checkout [name]
推送至远程仓库分支
git push [shortName] [name]
合并分支
git merge [name]
克隆
git clone xxx