vault backup: 2022-09-28 19:13:41

Affected files:
.obsidian/workspace
03. Programming/COM/20210726 - COM Interface.md
03. Programming/DB/MySQL.md
03. Programming/DB/sqlite.md
03. Programming/Design Pattern.md
03. Programming/FFMPEG/00. Introduction.md
03. Programming/FFMPEG/01. Setup.md
03. Programming/FFMPEG/FFMpeg.md
03. Programming/Flask.md
03. Programming/Media Foundation/20210604 - Windows media foundation.md
03. Programming/OpenCV.md
03. Programming/OpenGL.md
03. Programming/Python/argparse.ArgumentParser.md
03. Programming/Python/decorator.md
03. Programming/Python/logging.md
03. Programming/Python/opencv.md
03. Programming/Python/subprocess.md
03. Programming/Python/threading.md
03. Programming/Python/tkinter.md
03. Programming/Python/檢測工具.md
03. Programming/QT/Dropdown button.md
03. Programming/QT/QVariant.md
03. Programming/QT/Qt.md
03. Programming/UML.md
03. Programming/演算法.md
04. 資料收集/99. templates/blogHeader.md
04. 資料收集/99. templates/date.md
04. 資料收集/99. templates/front matter.md
04. 資料收集/99. templates/note.md
04. 資料收集/99. templates/table.md
04. 資料收集/99. templates/thisWeek.md
04. 資料收集/99. templates/日記.md
04. 資料收集/99. templates/讀書筆記.md
04. 資料收集/Linux/CLI/cut.md
04. 資料收集/Linux/CLI/scp.md
04. 資料收集/Linux/CLI/timedatectl.md
04. 資料收集/Linux/Programming.md
04. 資料收集/Linux/Ubuntu.md
04. 資料收集/Tool Setup/Hardware/RaspberryPi.md
04. 資料收集/Tool Setup/Software/Chrome.md
04. 資料收集/Tool Setup/Software/Obisidian.md
04. 資料收集/Tool Setup/Software/SublimeText.md
04. 資料收集/Tool Setup/Software/VirtualBox.md
04. 資料收集/Tool Setup/Software/Visual Studio Code.md
04. 資料收集/Tool Setup/Software/Windows Setup.md
04. 資料收集/Tool Setup/Software/Windows Terminal.md
04. 資料收集/Tool Setup/Software/freefilesync.md
04. 資料收集/Tool Setup/Software/vim.md
04. 資料收集/名言佳句.md
04. 資料收集/架站/Gitea.md
04. 資料收集/架站/HTTP Server/Apache.md
04. 資料收集/架站/HTTP Server/Nginx/Reverse Proxy(Layer4).md
04. 資料收集/架站/Pelican blog.md
04. 資料收集/架站/Proxmox VE.md
04. 資料收集/架站/SWAG Reverse proxy.md
04. 資料收集/架站/Storj.md
04. 資料收集/架站/Trojan.md
04. 資料收集/每週外食.md
04. 資料收集/科技/802.11.md
04. 資料收集/科技/HDR Sensor.md
04. 資料收集/科技/量子電腦.md
04. 資料收集/科技/鋰電池.md
04. 資料收集/興趣嗜好/RC/Traxxas Sledge.md
04. 資料收集/興趣嗜好/RC/好盈電變調整中立點.md
04. 資料收集/興趣嗜好/RC/差速器調教教學.md
04. 資料收集/興趣嗜好/模型/舊化作例.md
04. 資料收集/興趣嗜好/軍武/虎式.md
04. 資料收集/讀書筆記/20201201 - 學習如何學習.md
04. 資料收集/讀書筆記/20201218 - Kotlin權威2.0.md
04. 資料收集/讀書筆記/20201224 - 寫作是最好的自我投資.md
04. 資料收集/讀書筆記/20210119 - 中產悲歌.md
04. 資料收集/讀書筆記/20210220 - 最高學習法.md
04. 資料收集/讀書筆記/20210320 - 最高學以致用法.md
04. 資料收集/讀書筆記/20210406 - 精準購買.md
04. 資料收集/讀書筆記/20210723 - 高手學習.md
04. 資料收集/讀書筆記/20220526 - 深入淺出設計模式.md
04. 資料收集/讀書筆記/20220619 - 精確的力量.md
04. 資料收集/軟體工具/IPFS.md
04. 資料收集/軟體工具/MkDocs.md
04. 資料收集/軟體工具/Obsidian.md
04. 資料收集/軟體工具/docker.md
04. 資料收集/軟體工具/git/apply.md
04. 資料收集/軟體工具/git/submodule.md
04. 資料收集/軟體工具/youtube-dl.md
04. 資料收集/面試準備/技术面试最后反问面试官的话.md
This commit is contained in:
2022-09-28 19:13:41 +08:00
parent 0534f846d1
commit c847c7f07d
85 changed files with 7 additions and 7 deletions

View File

@@ -0,0 +1,36 @@
## apply
`git diff` 生出一個 diff 檔,而 `git apply` 把這個 diff 檔 apply 到某個 branch 上。
```
git diff ${A_COMMIT_HASH} ${B_COMMIT_HASH} > xxx.patch
git apply xxx.patch
```
- 如果在 `git apply` 的過程中遇到 trailing whitespace error 的話,可以參考這篇文章:[git - My diff contains trailing whitespace - how to get rid of it? - Stack Overflow](https://stackoverflow.com/questions/14509950/my-diff-contains-trailing-whitespace-how-to-get-rid-of-it),透過加入 `--whitespace=warn``--whitespace=nowarn` 參數來解決。
- [^1]
[^1]: [(2018 iThome 鐵人賽) Day 11: 使用 Git 時如何做出跨 repo 的 cherry-pick - iT 邦幫忙::一起幫忙解決難題,拯救 IT 人的一天](https://ithelp.ithome.com.tw/articles/10194972)
### Trouble shooting
- 如果在Windows上git clone遇到例如`error: invalid path``fatal: unable to checkout working tree`
```
$ gclogi git@github.com-logi:LogiVideoFW/VC_Bolide_TableHub.git
Cloning into 'VC_Bolide_TableHub'...
remote: Enumerating objects: 159, done.
remote: Counting objects: 100% (159/159), done.
remote: Compressing objects: 100% (134/134), done.
remote: Total 85001 (delta 71), reused 84 (delta 21), pack-reused 84842
Receiving objects: 100% (85001/85001), 599.21 MiB | 6.18 MiB/s, done.
Resolving deltas: 100% (17824/17824), done.
error: invalid path 'zynqLNX/kernel-source/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.c'
fatal: unable to checkout working tree
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'
```
有可能是因為檔名與NTFS規則有所衝突解法
```
cd <REPO_NAME>
git config core.protectNTFS false; git reset --hard HEAD
```

View File

@@ -0,0 +1,27 @@
## 建立 Git Submodule
```
git submodule add <repository> [<local_path>]
```
新增之後,用 git status 會發現多了兩個東西需要 commit
![[20220608152709_git_submodule.png|450]]
第一個檔案 .gitmodules裡面紀錄 submodule 的對應關係,內容大概像這樣:
```
[submodule "RobotRunQA"]
path = RobotRunQA
url = git@github.com-logi:JuiwenHsu/RobotRunQA.git
```
接下來剩3個步驟
1. 提交 `.gitmodule``git add .gitmodule ; git push origin master`
2. 跟git說我們有新增一個submodule`git submodule init`
3. 把submodule pull下來`git submodule update`
## Clone repository and submodule
當clone一個有submodule的repo的時候我們還需要 `git submodule init``git submodule update` ,例如:
```
git clone https://xxx/xxx.git
cd xxx
git submodule init
git submodule update
```