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

Open
DraperHXY opened this issue Jan 23, 2019 · 0 comments
Open

git #22

DraperHXY opened this issue Jan 23, 2019 · 0 comments

Comments

@DraperHXY
Copy link
Owner

DraperHXY commented Jan 23, 2019

分支管理

  • git branch 查看分支状况
  • git branch <branch_name> 新建一个新的分支
  • git branch -r 查看远程分支
  • git branch -f <a_branch> <b_branch>|<tag>|<hash> 强制移动前者的引用到后者
  • git branch -d <branch_name> 删除分支
  • git merge --no-ff <branch_name> 不使用fast-forward方式合并,保留分支的commit历史
  • git checkout -b myfeature develop 开始一项功能的开发工作时,基于develop创建分支。
  • git remote add origin <Url> 添加一个远程分支和 Url

仓库管理

  • git remote -v 查看远程仓库

diff

  • git diff 查看工作区(working directory)和暂存区(staged)之间差异
  • git diff HEAD 查看工作区(working directory)与当前仓库版本(repository)HEAD版本差异
  • git diff --cached / git diff --staged 查看暂存区(staged)与当前仓库版本(repository)
  • git diff --stat 不查看具体改动,只查看改动了哪些类

log

  • git log -p 查看日志,并查看每次修改的内容

Commit message 和 Change log 编写指南
让Git的输出更友好: 多种颜色和自定义log格式

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