Skip to content

Commit

Permalink
vault backup: 2024-10-21 17:52:38
Browse files Browse the repository at this point in the history
Affected files:
.obsidian/core-plugins.json
.obsidian/workspace.json
_posts/engineering/2024-09-11-git版本管理常见技巧.md
_posts/pool/2024-10-18-日记.md
_posts/pool/2024-10-21.md
  • Loading branch information
cmgzn committed Oct 21, 2024
1 parent 416463c commit 5122d31
Show file tree
Hide file tree
Showing 5 changed files with 156 additions and 50 deletions.
50 changes: 30 additions & 20 deletions .obsidian/core-plugins.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,30 @@
[
"file-explorer",
"global-search",
"switcher",
"graph",
"backlink",
"canvas",
"outgoing-link",
"tag-pane",
"page-preview",
"daily-notes",
"templates",
"note-composer",
"command-palette",
"editor-status",
"bookmarks",
"outline",
"word-count",
"file-recovery"
]
{
"file-explorer": true,
"global-search": true,
"switcher": true,
"graph": true,
"backlink": true,
"canvas": true,
"outgoing-link": true,
"tag-pane": true,
"properties": false,
"page-preview": true,
"daily-notes": true,
"templates": true,
"note-composer": true,
"command-palette": true,
"slash-command": false,
"editor-status": true,
"bookmarks": true,
"markdown-importer": false,
"zk-prefixer": false,
"random-note": false,
"outline": true,
"word-count": true,
"slides": false,
"audio-recorder": false,
"workspaces": false,
"file-recovery": true,
"publish": false,
"sync": false
}
66 changes: 44 additions & 22 deletions .obsidian/workspace.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,21 @@
"type": "split",
"children": [
{
"id": "ac5d149d3a54bb3d",
"id": "077f9b345e160d73",
"type": "tabs",
"children": [
{
"id": "a7dc62ad9734e7f6",
"id": "1e2086f0928a3cb6",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "_posts/pool/2024-10-18-不太安全但管用的docker非root用户权限问题.md",
"file": "_posts/engineering/2024-09-11-git版本管理常见技巧.md",
"mode": "source",
"source": false
}
},
"icon": "lucide-file",
"title": "2024-09-11-git版本管理常见技巧"
}
}
]
Expand All @@ -39,7 +41,9 @@
"type": "file-explorer",
"state": {
"sortOrder": "alphabetical"
}
},
"icon": "lucide-folder-closed",
"title": "文件列表"
}
},
{
Expand All @@ -54,15 +58,19 @@
"collapseAll": false,
"extraContext": false,
"sortOrder": "alphabetical"
}
},
"icon": "lucide-search",
"title": "搜索"
}
},
{
"id": "e68d852ddb2ca624",
"type": "leaf",
"state": {
"type": "bookmarks",
"state": {}
"state": {},
"icon": "lucide-bookmark",
"title": "书签"
}
}
]
Expand All @@ -85,15 +93,17 @@
"state": {
"type": "backlink",
"state": {
"file": "_posts/pool/2024-10-18-不太安全但管用的docker非root用户权限问题.md",
"file": "_posts/engineering/2024-09-11-git版本管理常见技巧.md",
"collapseAll": false,
"extraContext": false,
"sortOrder": "alphabetical",
"showSearch": false,
"searchQuery": "",
"backlinkCollapsed": false,
"unlinkedCollapsed": true
}
},
"icon": "links-coming-in",
"title": "2024-09-11-git版本管理常见技巧 的反向链接列表"
}
},
{
Expand All @@ -102,10 +112,12 @@
"state": {
"type": "outgoing-link",
"state": {
"file": "_posts/pool/2024-10-18-不太安全但管用的docker非root用户权限问题.md",
"file": "_posts/engineering/2024-09-11-git版本管理常见技巧.md",
"linksCollapsed": false,
"unlinkedCollapsed": true
}
},
"icon": "links-going-out",
"title": "2024-09-11-git版本管理常见技巧 的出链列表"
}
},
{
Expand All @@ -116,7 +128,9 @@
"state": {
"sortOrder": "frequency",
"useHierarchy": true
}
},
"icon": "lucide-tags",
"title": "标签"
}
},
{
Expand All @@ -125,32 +139,40 @@
"state": {
"type": "outline",
"state": {
"file": "_posts/pool/2024-10-18-不太安全但管用的docker非root用户权限问题.md"
}
"file": "_posts/engineering/2024-09-11-git版本管理常见技巧.md"
},
"icon": "lucide-list",
"title": "2024-09-11-git版本管理常见技巧 的大纲"
}
},
{
"id": "f880743501d2682d",
"type": "leaf",
"state": {
"type": "git-view",
"state": {}
"state": {},
"icon": "git-pull-request",
"title": "Source Control"
}
},
{
"id": "e8de34de54193280",
"type": "leaf",
"state": {
"type": "calendar",
"state": {}
"state": {},
"icon": "calendar-with-checkmark",
"title": "Calendar"
}
},
{
"id": "38349e1975fac19a",
"type": "leaf",
"state": {
"type": "copilot-chat-view",
"state": {}
"state": {},
"icon": "message-square",
"title": "Copilot"
}
}
],
Expand All @@ -173,12 +195,15 @@
"obsidian-excalidraw-plugin:新建绘图文件": false
}
},
"active": "a7dc62ad9734e7f6",
"active": "1e2086f0928a3cb6",
"lastOpenFiles": [
"_posts/pool/2024-10-21.md",
"_posts/pool/2024-10-18-日记.md",
"_template/time_note.md",
"_posts/pool/2024-10-16-as-rag模块拓展思考.md",
"_posts/pool/2024-10-18-npm_Node.js探秘.md",
"_posts/pool/2024-10-18-不太安全但管用的docker非root用户权限问题.md",
"_posts/pool/2024-10-18-Pinokio_AI浏览器调研.md",
"_posts/pool/2024-10-16-as-rag模块拓展思考.md",
"_posts/engineering/2024-09-14-微信引入个人机器人踩雷篇.md",
"_posts/engineering/2024-09-13-pip国内加速.md",
"_posts/engineering/2024-09-13-linux安装全局可用的conda+创建有root权限的新账号.md",
Expand All @@ -198,10 +223,7 @@
"_posts/pool/2024-09-21.md",
"_posts/pool/2024-09-25.md",
"_posts/pool/2024-10-08.md",
"_posts/engineering/2024-10-16-Elasticsearch之一百种你不得不记的RESTful api.md",
"assets/img/mrj9tyfxgpwc4ohkdhkq3uu3azxww8g.png",
"_posts/brain/2024-09-06-github_page+obsidian实现个人笔记云管理.md",
"_posts/brain/2024-09-20-obsidian ios多平台同步超完美方案.md",
"assets/img/Dingtalk_20240906094335.jpg",
"assets/img/Dingtalk_20240906103403.jpg",
"assets/img/Dingtalk_20240906103705.jpg",
Expand Down
69 changes: 61 additions & 8 deletions _posts/engineering/2024-09-11-git版本管理常见技巧.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ tags:
- github
---
## 强制远程覆盖本地分支
```git
```bash
git fetch --all && git reset --hard origin/master && git pull
```
其中`origin/master`为远程分支名,查询相应的远程分支名请使用:
```git
```bash
git branch -r
```
拓展:查询本地仓库分支名
```git
```bash
git branch -a
```

Expand All @@ -34,30 +34,83 @@ Tips:
1. 开两个`git bash`
2. 其中一个使用命令`git log`查询需回退的commit相应版本号,复制
3. 另一个使用命令:
```git
```bash
git reset --soft 版本号
```
4. 强制同步到远程分支:
```git
```bash
git push --force
```
此操作不影响本地更改

## 合并某次提交至指定分支

与上一主题类似,取版本号后,切换到需要**合并至**的分支:
```git
```bash
git checkout branch-name
```
拓展:新建分支
```git
```bash
git checkout -b new-branch-name
```
合并提交至本分支:
```git
```bash
git cherry-pick 版本号
```
执行后,若有冲突,会在相应文件中显示,vscode打开可一一核对,核对后在右下角检查完成合并即可。

TODO: 如何快速强制覆盖

## 与主库同步进度(变基)

在提交 Pull Request (PR) 之前,建议你将你的分支变基到最新的远程主库,这样可以确保你的代码和主库是最新的,从而减少潜在的合并冲突。这是一个良好的实践。

1. **获取最新的远程分支信息**

首先,你需要确保你的本地仓库是最新的。运行以下命令来获取远程代码的最新状态:

```bash
git fetch origin
```

2. **切换到你的工作分支**

```bash
git checkout feature-branch
```

3. **执行变基**

现在,可以将你的分支变基到最新的远程主分支(例如 `main``develop`,具体取决于你的项目):

```bash
git rebase origin/main
```

这将重放你的提交在最新的远程分支之上,确保你的代码是基于最新状态的。

4. **解决冲突(如果有的话)**

如果在变基过程中遇到冲突,Git 会提示你解决这些冲突。你需要手动编辑相关文件以解决冲突。解决完后,继续变基:

```bash
git add <resolved_file>
git rebase --continue
```

如果需要放弃变基,可以运行:

```bash
git rebase --abort
```

5. **推送到远程库**

一旦变基成功,就可以推送了。
有时,你需要强制推送你的分支到远程库,因为变基会更改提交历史:

```bash
git push origin feature-branch --force
```

**注意**: 强制推送会覆盖远程分支的历史,请确保你是在你自己的特性分支上,且对其他人没有影响。
14 changes: 14 additions & 0 deletions _posts/pool/2024-10-18-日记.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: 日记
author: X
date: 2024-10-18 16:41:03 +0800
categories:
- diary
- 24年
tags:
---
今天同时探索了中文版斯坦福小镇和flowise,都是闲着没事搜as发现的。

flowise是油管下评论看到的

这两个都是node.js相关
7 changes: 7 additions & 0 deletions _posts/pool/2024-10-21.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title:
author: X
date: "2024-10-21 17:46:31 +0800"
categories:
tags:
---

0 comments on commit 5122d31

Please sign in to comment.