让 Cursor AI 帮忙写 git commit message
不是不想写 commit message,而是每次审阅代码+组织语言去准确描述比较难,耗费精力和时间。
让 Cursor AI 来辅助撰写,提高效率,也学习如何用 Commits 规范和英文去总结和表达。
不是不想写 commit message,而是每次审阅代码+组织语言去准确描述比较难,耗费精力和时间。
让 Cursor AI 来辅助撰写,提高效率,也学习如何用 Commits 规范和英文去总结和表达。
可在 wrangler.toml 文件中直接配置开发环境变量。例如:
[env.development]
[env.development.vars]
ENVIRONMENT = "development"
GITHUB_CLIENT_ID = "your github client id" # 自定义环境变量示例
但密钥等敏感信息,建议放在独立的开发环境变量配置文件 .dev.vars
中,
并将其从 git 中排除(在.gitignore
文件中添加 .dev.vars
文件路径),
以防止密钥泄露。
如何将所有的 git commits 的描述导出到文本文件?
示例:git log --pretty=format:"%h %an %ad %s" --date=short > commits.txt
参数说明:
--pretty=format:
指定输出格式,其中
%h
是提交的简短哈希%s
是提交的摘要/标题(summary)%b
,提交的描述(body)%n
,换行符%an
是提交的作者名字%ad
提交日期--date=short
选项下会使用简短的日期格式
默认的日期格式示例 Sun Oct 6 00:56:25 2024 +0800
,简短的日期格式示例 2024-10-06
创建一个基本的 JavaScript 开发环境,以满足两个要求:
mkdir my-js-project
cd my-js-project
npm init -y
这会创建一个 package.json 文件,通过此跟踪项目的依赖、以及相关开发环境的配置。
假设有目录 dirA,之前该目录已经有过 commit 记录,当我们修改文件结构,不再需要跟踪和记录 dirA
路径下的文件变化时,
还需要执行以下步骤来处理:
使用 flex 布局,两端元素默认内容宽度,中间元素自动扩充到最大宽度。
|left| <- center -> |right|
HTML
<div class="h">
<div class="left">左/上</div>
<div class="middle">中</div>
<div class="right">右/下</div>
</div>
<br />
<div class="v">
<div class="left">左/上</div>
<div class="middle">中</div>
<div class="right">右/下</div>
</div>
CSS
div {
border: 1px solid #ccc;
}
.h {
/* 水平/横向 */
display: flex;
flex-direction: row;
}
.v {
/* 垂直/纵向 */
display: flex;
flex-direction: column;
height: 300px; /* 需要设置固定高度 */
}
.middle {
flex: 1 1 auto; /* flex-grow | flex-shrink | flex-basis */
align-items: center; /* 元素水平居中 */
text-align: center; /* 文本水平居中 */
align-content: center; /* 元素垂直居中 */
}
.left,
.right {
/* nothing */
}
前置:注释、定界符等基本语法
document-css
启用在 styles.html 部分中包含的大部分 CSS(可以使用命令 pandoc --print-default-data-file=templates/styles.html
查看)。除非你使用 --css
,否则此变量默认设置为 true
。你可以使用例如 pandoc -M document-css=false
来禁用它。
title
, author
, date
(标题,作者,日期)
能够帮助我们识别文档的基本信息。这些信息可以通过 LaTeX 和 ConTeXt 设置在 PDF 的元数据中。我们可以通过 pandoc title block 来设置这些信息,这种方式支持多作者,或者我们也可以通过 YAML 元数据块来设置,例如: