How do I open a new git bash terminal window at my current location in windows?
When running git bash, I can open a new bash window at my root with Alt+F2
I can open a windows explorer window at the current directory path
$ explorer .
Trying
$ sh
to open a new terminal window at my location just returns
sh: __git_ps1: command not found
and opens the shell in the current window without git running.
How can I quickly open a new bash shell at my location?
Solution 1:
StuperUser answer is correct, but I want to add that besides adding shell script in a PATH environment it's also possible to add a simple bash alias into .bashrc
or .bash_profile
files.
Just create alias:
alias git-bash='/git-bash.exe & > /dev/null 2&>1'
bashrc and bash_profile it's a standard BASH configuration files, you can found them in your user home folder.
More information Bash startup files
Solution 2:
Since this is specifically for a git-bash terminal, add the Git directory (C:\Program Files\Git) to your path (https://www.howtogeek.com/118594/how-to-edit-your-system-path-for-easy-command-line-access/)
Then run
$ git-bash
to open a new git-bash at the current location.
But to avoid blocking the current terminal it will be necessary to use & > /dev/null 2&>1
to run in the background and pipe the result into null (see https://superuser.com/a/1314830/641), so added the command to a .sh in the directory to call it simply.