Git:修订间差异

来自康健生活
Kangkk​(留言 | 贡献)
无编辑摘要
Kangkk​(留言 | 贡献)
无编辑摘要
第21行: 第21行:
git commit -a -m "edit the file"
git commit -a -m "edit the file"
</syntaxhighlight>}}
</syntaxhighlight>}}
== log ==
=== 查找人 ===
查找单人。
{{shc|<syntaxhighlight lang="bash">
git log --online --author="kangjian"</syntaxhighlight>|$|/home/kangkk}}
查找多人。
{{shc|<syntaxhighlight lang="bash">
git log --online --author="kangjian\|lanqian"</syntaxhighlight>|$|/home/kangkk}}
=== 查找关键字 ===
{{shc|<syntaxhighlight lang="bash">
git log --online --grep="kangkk"</syntaxhighlight>|$|/home/kangkk}}
=== 查找文件内容信息 ===
{{shc|<syntaxhighlight lang="bash">
git log -S "75cdn"</syntaxhighlight>|$|/home/kangkk}}
=== 查找时间区间 ===
查找自2021年2月24日以后,早上10点到下午8点的记录。
{{shc|<syntaxhighlight lang="bash">
git log --online --since="10am" --until="8pm" --after="2021-02-24"</syntaxhighlight>|$|/home/kangkk}}
=== 查看文件 ===
{{shc|<syntaxhighlight lang="bash">
git log src/a.js</syntaxhighlight>|$|/home/kangkk}}
查看文件改动记录。
{{shc|<syntaxhighlight lang="bash">
git log -p src/a.js</syntaxhighlight>|$|/home/kangkk}}
== reflog ==
{{shc|<syntaxhighlight lang="bash">
git reflog</syntaxhighlight>|$|/home/kangkk}}


== commit ==
== commit ==