Files
Obsidian-Main/02. PARA/03. Resources(資源)/git.md
2022-06-02 17:55:14 +08:00

1.8 KiB
Raw Blame History

apply

git diff 生出一個 diff 檔,而 git apply 把這個 diff 檔 apply 到某個 branch 上。

git diff ${A_COMMIT_HASH} ${B_COMMIT_HASH} > xxx.patch
git apply xxx.patch

Trouble shooting

  • 如果在Windows上git clone遇到例如error: invalid pathfatal: 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