常用功能
先放一个链接
https://blog.csdn.net/h247263402/article/details/74849182
Commitizen
http://www.ruanyifeng.com/blog/2016/01/commit_message_change_log.html
非常用功能
导出diff 的文件
- 场景
- 用php做了一个局域网的项目
- 没有外网,更新还要用u盘
- 需求在不断的改,改完就去跑去现场更新代码
- 开始是把整个项目拷下来,用rsync同步代码
- 直到一次不小心把config文件覆盖了
解决
git的导出diff的文件
以下:
Below commands worked for me.
If you want difference of the files changed by the last commit:
1 | git archive -o /path/to/file.zip HEAD $(git diff --name-only HEAD^) |
or if you want difference between two specific commits:
1 | git archive -o update.zip 4d50f1ee78bf3ab4dd8e66a1e230a64b62c49d42 $(git diff --name-only 07a698fa9e5af8d730a8c33e5b5e8eada5e0f400) |
or if you have uncommitted files, remember git way is to commit everything, branches are cheap:
1 | git stash |
其它
目前没有