簡體   English   中英

如何從文件中獲取要添加到 git 存儲庫的文件?

[英]How to source the files to be added to a git repo from a file?

我想始終將相同的文件添加到我的 git 存儲庫中,並且我認為將文件文件添加到 git 將是一種簡單的方法。

請問git add如何從文件中讀取要添加的文件?

使用標准 cli 工具也很容易做到這一點:

# bash:
git add $(cat file)

# xargs is standard on linux, and comes with git-bash on Windows :
cat file | xargs git add

似乎git add --pathspec-from-file=file正是我想要的。

只需確保所有行都是有效的文件名。 而且沒有一個是空的。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM