![](/img/trans.png)
[英]Large file support: Normal files and git annex files in the same repo on windows? git add fails with fatal: This operation must be run in a work tree
[英]List all files in git repo not added by `git annex add`
有沒有辦法列出我通過git add
(參考 1)而不是通過git annex add
(參考 2)添加的所有文件?
mkdir myrepo
cd myrepo
git init .
mkdir foo
dd if=/dev/random of=foo/bar.ext count=1024 bs=1024
git add foo # <----- ref 1
git commit -m "add foo"
git annex init "listing"
mkdir baz
dd if=/dev/random of=baz/abc.ext count=1024 bs=1024
dd if=/dev/random of=baz/efg.ext count=2024 bs=1024
dd if=/dev/random of=baz/xyz.ext count=512 bs=1024
git annex add baz # <---- ref 2
git commit -m "add baz"
所以當我運行git <some command>
它應該顯示類似
foo/bar.ext
我使用的解決方案之一是https://stackoverflow.com/a/61680771/7274758 。 但我想知道是否有更好的方法?
ls-files
列出 repo 中的所有文件。annex find
列出附件中的所有文件。git ls-files > ~/tmp/ls-files.list
git annex find > ~/tmp/annex-find.list
awk 'FNR==NR {a[$0]++; next} !a[$0]' ~/tmp/annex-find.list ~/tmp/ls-files.list
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.