When the code
SRC=$(cd $(dirname "$0"); pwd)
is executed inside a Bash script on a system that has Git for Windows installed in c:\program files\Git, the SRC will get the value /c/program.
How do I make this work? I need to get the path to where the script is and use that to include other scripts with a relative path. In my case the next line is: source "${SRC}/common/common.sh"
The script is in c:\program files\Git\usr\bin so I can use git <command-name> and extend Git with some useful hand-made commands for feature branch workflow with rebase and submodules.
The source code is at https://github.com/jlovs/git-scripts if anyone want to help out.
SRCto be exactly?SRC=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )