Wscats / articles

🔖My Learning Notes and Memories - 分享我的学习片段和与你的回忆

Home Page:https://github.com/Wscats/articles

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Git操作

Wscats opened this issue · comments

git log
查看我们修改过的历史记录
image

git reset --hard commit id
这是回退到某个版本,commit id号可以只是截取开始的一部分
image

dir
查看文件夹目录里面的所有文件

cat
打印某个文件
image

git reflog
查看记录你执行过的每一次命令
image

git checkout
切换到某个分支
image

git status
push前看看修改过了什么文件
image

git branch -d xxxx
删除本地分支,注意在当前这个分支不能删除自己,只能切换到其他分支再删除当前的这个分支
image

git branch -a
查看本地和远程分支
image

git merge xxx
合并xxx分支到当前分支
image

git add [<file>]
添加文件到缓存区,也可以 "git add ." 添加所有文件到缓存
image

git diff [<file>]
比较当前文件和暂存区文件差异
image

git checkout [<file>]
回滚指定文件
image

看不够的感觉,