Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Git操作 #20

Closed
Wscats opened this issue May 21, 2016 · 1 comment
Closed

Git操作 #20

Wscats opened this issue May 21, 2016 · 1 comment
Labels

Comments

@Wscats
Copy link
Owner

Wscats commented May 21, 2016

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

@Wscats Wscats added the notes label Jun 3, 2016
@MrZhangDQ
Copy link

看不够的感觉,

@Wscats Wscats closed this as completed Aug 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants