Git "shortcut" for file path?

Is there any shortcut to the file path because it is very annoying to write the full path again and again?

Some regex or something else.

I know, I can use the Tab key, but ...

UPDATE:

Windows and default sh.exe from Git

ANSWER:

The git extensions from holygeek is what I'm looking for, but its version only works on * NIX-like systems or cygwin with a newer version of Bash.

This is the reason why I created a small patch for msysgit => here

+6
git
source share
3 answers

I wrote a tool that allows me to use numbers when working with files in git (git -number).

I use it on linux (a pair of shell scripts and a perl script).

If you're feeling adventurous, try getting him to work on windows.

It was a big performance boost for me, since I do not rely on tab completion, and I no longer need to write file or directory names when working with files in git.

git -number: https://github.com/holygeek/git-number

+3
source share

in git - bash, try

declare -x YOURVARIABLENAMEHERE=C:/.../.../ cd $YOURVARIABLENAMEHERE 

returns me to the specified directory.

+7
source share

I understand what you are asking, but I'm not sure what solution you think. If your file path is potentially β€œshortened,” why don't you change the folder names directly?

I am not an expert, but I suspect that for use on the command line you will not find much better than what you already have.

Using a GUI with a folder browser might be what you want? (for windows , for linux )

(If you perform many operations on multiple files in the same subfolder, you can go to this folder and run your commands from there - although you can check if specific git commands can really handle this)

EDIT If there is only one or more folders that you always need to reference, you can configure the shell variable, as bstpierre suggests in your comment on your question.

+1
source share

All Articles