git --version ====== 验证git是否成功安装
git config --list ====== 显示当前的git配置
git config --global user.name "xxx" ====== 设置提交仓库时的用户名信息
git config --global user.email "xxx@qq.com" ====== 设置提交仓库时的邮箱信息
git init ====== 在当前目录新建一个git代码库
git clone [url] ====== 下载一个项目和它的整段代码历史,url格式:https://github.com/[userName]/reposName
git add [file1] [file2] ====== 添加指定文件到暂存区
git rm [file1] [file2] ====== 删除工作区文件,并将这次删除放入暂存区
git mv [file_origin] [file_renamed] ====== 重命名文件,并将这个重命名放入暂存区
git commit -m [message] ====== 提交暂存区到仓库
git commit -a -m [message] ====== 直接从工作区提交到仓库(前提是该文件已有仓库中的历史版本)
git status ====== 查看每次的变更信息
git log ====== 查看历史信息
git remote add [shortname] [url] ====== 增加远程仓库,并命名
git remote -v ====== 查看本地仓库连接的远程仓库
git push [remote] [branch] ====== 将本地的提交推送到远程仓库
git pull [remote] [branch] ====== 将远程仓库的提交下拉到本地