Questions tagged «git-ls-files»

9
Git:仅列出“未跟踪”文件(也是自定义命令)
有没有办法使用git ls-files仅显示未跟踪文件的命令? 我问的原因是因为我使用以下命令来处理所有已删除的文件: git ls-files -d | xargs git rm 对于未跟踪的文件,我想要类似的内容: git some-command --some-options | xargs git add 我能够找到的-o选项git ls-files,但这不是我想要的,因为它还显示了被忽略的文件。我还能够提出以下冗长而丑陋的命令: git status --porcelain | grep '^??' | cut -c4- | xargs git add 似乎必须在这里使用更好的命令。如果没有,如何创建自定义git命令?
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.