在任意目录右键选择git bash可以进入执行行执行Linux命令
初始化目录
使用git时需要把当前目录转换成git目录,初始化一个目录命令:git init
创建git项目提交身份
配置局部身份
git config user.name wangxiansheng 设置提交名
git config user.email [email protected] 设置提交邮箱
配置全局用户
git config --global user.name wangXiansheng 设置全局提交名
git config --global user.email [email protected] 设置全局提交邮箱
优先级原则:就近原则,有局部用局部,没有局部用全局。
查看当前版本的状态
git status
提交文件
将文件提交到缓冲区
提交到缓冲区,没有提交到本地库的状态
提交文件到本地库:git commit 2.txt
写入文件信息
提交文件到本地库的常见方式
git commit -m “描述” 文件名(提交指定文件)
git commit -m “描述” 不写文件名 (不写文件名会提交当前缓冲库当中的所有文件)
提交成功的状态为
查看版本信息
查看详细版本信息:git log
列表性展示版本信息:git reflog