ctrl 加滚轮 放大字体
在计算机任意位置单击右键,选择::Git Bash Here
git version
git清屏命令:ctrl L
查看用户名和邮箱地址:
$ git config user.name
$ git config user.email
修改用户名和邮箱地址:
$ git config --global user.name "xxxx"
S git config --global user.email "xxxx"
git init 初始化本地仓库
git status 查看本地仓库状态
git add 文件名 添加到暂存区
git commit -m '日志信息'文件名 提交到本地库
git reflog 查看历史记录
git reset --hard 版本号 版本穿梭
工作区
暂存区 可删除 git rm --cached aa.txt
本地库 生成历史版本号,不可以删除
远程库
本地库
git commit
暂存区
git add
工作区(写代码)
首次初始化本地库:
On branch master
No commits yet // 当前还没有提交过任何东西
nothing to commit (create/copy files and use "git add" to track)
//没有什么好提的 创建/复制文件并使用“ git add”来跟踪
On branch master
No commits yet
Untracked files: 未被追踪的文件
(use "git add <file>..." to include in what will be committed)
aa.txt
//使用“ git add < file > ...”来包含将要提交的内容
nothing added to commit but untracked files present (use "git add" to track)
//没有添加到提交中,但是显示了 untracked 文件(使用“ git add”来跟踪)
指令了 git add aa.txt后
$ git status
On branch master
No commits yet
Changes to be committed:
(use "git rm --cached <file>..." to unstage) //使用“ git rm —— cached < file > ...”卸载
new file: aa.txt
//要提交的更改: new file: aa.txt
//删除暂存区的文件 git rm --cached aa.txt,这个时候git status查看,此文件又变成红的了,未被追踪的文件
执行了git commit 后,再次执行git status命令后
$ git status
On branch master
//没什么可承诺的,干净利落地工作
nothing to commit, working tree clean
修改文件后 执行git status
在这里插入代码片