Git 尝试将文本文件的行作为参数传递给命令

Git 尝试将文本文件的行作为参数传递给命令,git,bash,git-bash,Git,Bash,Git Bash,我在用于Windows的git命令行(gitbash?)中执行此操作,因此可能会导致问题(Windows现在不知道换行是什么) 尝试通过以下方式将文件中的路径传递到git: $ while read p; do git checkout dev $p; done <test.txt ' did not match any file(s) known to git. ' did not match any file(s) known to git. $whilereadp;做git签出

我在用于Windows的git命令行(gitbash?)中执行此操作,因此可能会导致问题(Windows现在不知道换行是什么)

尝试通过以下方式将文件中的路径传递到git:

$ while read p; do   git checkout dev $p; done <test.txt
' did not match any file(s) known to git.
' did not match any file(s) known to git.

$whilereadp;做git签出dev$p;完成了test.txt中的特殊字符。您可以使用
cat-A test.txt
Look specially for carries returns查看
echo“git checkout dev[$p]”
show?@WalterA我使用它创建了一个文本文件,其中包含以下命令:
while read p;执行echo“git签出开发程序\$p\”;done commands.txt
然后我只需将commands.txt的内容复制粘贴到命令行中即可。Does
/commands.txt
work?
$ while read p; do   echo $p; done <test.txt
one.txt
two.txt