1 下载地址
Windows版本:https://git-scm.com/download/win
Git-2.29.1-64-bit.exe 2.29.1
2 相关命令
git init 初始化代码仓库
git status 查询仓库索引状态
git add <文件名/目录> 添加文件到仓库
git config --global user.email “you@example.com” 配置全局的提交者邮箱
git config --global user.name “Your Name” 配置全局的提交者名字
git commit -m “add component to project " --author=” Your Name < you@example.com>" 提交暂存内容(不带文件名的提交)
git commit somefile 提交修改后的文件(原先已经add/commit过)
export GIT_EDIT=vim 设置提交时编辑变更信息的编辑器
git log 查看提交记录
git show <提交码> 查看某次提交详细的变更信息
git show-branch --more=n 查看简洁的单行提交信息
git diff <提交码> <提交码> 查看两个提交之间的差异
git rm <文件名> 删除文件 (需要进一步git commit)
git rm -r <文件夹> 删除文件夹(需要进一步git commit)
git mv <source文件> <Target文件> 重命名
git clone 创建版本库的符本
git config –l 列出配置
git config –unset 移除设置
git reset ––hard 将版本库和工作目录改变为已知状态
git checkout HEAD – <文件> 恢复文件的旧版本
git checkout HEAD – <文件夹>恢复文件的旧版本