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 #1

Open
duxinyues opened this issue Jul 20, 2021 · 0 comments
Open

git #1

duxinyues opened this issue Jul 20, 2021 · 0 comments

Comments

@duxinyues
Copy link
Owner

记录
git reflog 查看和编辑引用日志
git log -g 查看引用日志的历史记录
git log --since=2.weeks 查询两周内的提交记录
git log --author 查询某个用户的提交记录
git log --grep="搜索信息" 搜索提交信息
git log --first-parent 查看当前元素的第一个父对象
git log --max-parents=0 查询项目的起点
提交
git add 对更新文件进行暂存,为它们添加快照【文件当前的状态】
git commit 创建一个新的修订,把存放在暂存区的文件信息作为修订版本永久存放到本地版本库中。
git commit -m "提交信息" 编辑提交的信息
git status 查询已变更但未提交的文件
git diff 查看用户编辑但未将其暂存的文件
git diff HEAD 比较当前的工作目录和最近一次提交的修订之前的差异
分支
git branch 创建一个新分支【不带参数时,该命令查询分支列表】
git checkout -b string 切换到新建的分支上
git symbolic -ref HEAD 获取当前分支名称
git rev-parse HEAD 找到当前提交的SHA-1码
git show-ref 或者 git for-each-ref 显示所有分支
git branch --list 显示分支列表
git remote show 显示远程版本库的信息,包含远程分支的查询

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant