Using Git aliasing for changing directory in Windows CMD

52 Views Asked by At

This is arguably a convoluted question, but is there a way to create a Git command to change directory using aliasing, but to be used in the Windows command prompt?

The goal is to leverage Git's straightforward aliasing functionality and avoid more complex solutions native to cmd, see for example this answer.

To illustrate, the below shows what I am trying to do:

> git config --system alias.foo "cd <long_directory_name>"
> cd
<some_directory>
> git foo
> cd
<long_directory_name>

Of course the above fails because cd is not recognized as a Git command.

0

There are 0 best solutions below