比起开Notion搜Notes,说不定看自己的blog更快。本着这样优化掉Notion的想法把git笔记迁移过来。

基本流程

  • git init

  • git checkout -b [name]

  • git remote add upstream [SSH] (PULL对象)

  • git remote add origin [SSH of fork] (PUSH对象)

  • git clone [SSH of fork]

  • git add

  • git commit -m [words]

  • git push

后续步骤

  • 查看当前远程仓库:git remote -v

  • 如果更新了分支:git push --set-upstream origin [branch_name]

  • 同步远程分支更新到本地:git pull origin main

  • 删除当前origin:git remote remove origin

  • git fatal error:

拉取特定PR

情景:想使用Obsidian某插件的未Merge PR。
解决方案:拉取源码后构建,用构建结果替换.obsidian内文件。

步骤:

  1. 找到当前插件目录 VAULT\.obsidian\plugins\obsidian-auto-link-title,酌情备份

  2. 在别的临时目录拉取PR源码

1
2
3
4
git clone https://github.com/zolrath/obsidian-auto-link-title.git 
cd obsidian-auto-link-title
git fetch origin pull/158/head:pr-158
git checkout pr-158
  1. 安装依赖并构建

1
2
npm install
npm run build
  1. 把构建后的文件复制到第一步的插件目录 ,通常至少覆盖这几个文件:

1
2
3
main.js
manifest.json
styles.css
  1. 回到 Obsidian 里重载插件

参考:


本站总访问量次!

本站由 Yantares 使用 Stellar 1.33.1 主题创建。
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议,转载请注明出处。

发表了 117 篇文章 · 总计 195.9k 字