简体   繁体   English

如何在zsh中完成“git add”完整路径?

[英]How completion “git add” full path in zsh?

Git add not list all file, only give a layer of a layer to choose file. Git add not list all file,只给一层图层来选择文件。

Such as

└── src
    └── main
        └── java
            └── com
                ├── A.java
                └── B.java

if I type $ git add <tab> 如果我输入$ git add <tab>

it will be 这将是

$ git add src/main/java/com/A.java
A.java  B.java

How to do this: 这个怎么做:

$ git add <tab>
src/main/java/com/A.java
src/main/java/com/B.java

Autocompletion in zsh already put for you the path until there is a difference and only shows you what is different. zsh自动完成功能已经为您提供了路径,直到存在差异,并且只显示您的不同之处。 At the end once you've confirmed/chosen the one you want, the whole path will be printed. 最后,一旦你确认/选择了你想要的那个,就会打印出整个路径。 To circle through the propositions, you keep pressing the TAB key. 要圈选命题,请按住TAB键。

In your example there are only 2 files, and the difference only starts with the file name A or B. This is why it writes it for you. 在您的示例中,只有2个文件,差异仅以文件名A或B开头。这就是它为您编写的原因。 If you want the other file, just press TAB again and your input will be changed accordingly. 如果您想要其他文件,只需再次按TAB键,您的输入就会相应更改。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM