git log、git tag、git branch

2018-06-09  本文已影响54人  michael_jia

git log

git log 用于查看每个提交的日志(Show commit logs)。从 Viewing the Commit History 开启了解 git log 的新视角。

好的注释可以让人一下子就了解本次修改的目的,比如修改了哪个BUG,解决了什么问题,实现了什么功能。

至于具体修改了哪些文件,通过 git log --name-status 即可查知,没有必要在 commit 的注释中体现。

git tag

Tag objects (created with -a, -s, or -u) are called "annotated" tags; they contain a creation date, the tagger name and e-mail, a tagging message, and an optional GnuPG signature. Whereas a "lightweight" tag is simply a name for an object (usually a commit object).
Annotated tags are meant for release while lightweight tags are meant for private or temporary object labels. For this reason, some git commands for naming objects (like git describe) will ignore lightweight tags by default.

Before fetching, remove any local tags that no longer exist on the remote if --prune is enabled. This option should be used more carefully.


git fetch --prune --prune-tags
上一篇 下一篇

猜你喜欢

热点阅读