Question

I have a big project, in which while working on any feature, I could be making edits to 6-8 files, each in turn nested some 6-10 levels. (Currently I copy paste the whole filepath using ctrl+shift+c, ctrl+shift+v, but it can get frustrating when there are spaces in the filepath)

When I do a git diff <filename>, or a git checkout <filename> for reviewing/removing my changes, is there a way I can get suggestions for the filenames which have been modified?

Some feature or hack? Something like git diff -> tab displaying me a list of options from files modified.

Was it helpful?

Solution

Oh-My-ZSH provides a plugin that tab-autocompletes tracked file paths (i.e. in the index).

https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/gitfast/git-completion.bash

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top