Is there a way to open a folder/directory from git bash/shell emulator? I know you can use 'start' then the file name to open one file, but is there a way to open the entire folder?
Edit: If you're trying to open an entire folder with Visual Studio Code (which is what I was trying to do), follow these steps:
Haven't used "Git Bash"... I assume it is a bash shell emulator. If so, try:
cd <folder>
cd stands for Change Directory.
To open the current folder, try:
start .
The '.' is the current folder. To open in VS Code try:
code .
code
CLI needs to be installed. More info on use here.
I use this alias in my ~/.bashrc
to mirror the open
functionality I miss from OSX:
function open() {
# if argument != '.', open full-path to argument
[ "$@" = '.' ] && dir_path="." || dir_path=$(realpath "$@")
start $dir_path
}
You can use it to open relative paths to directories: open /relativeDirectory
Here's the same code in an easier to read manner:
function open() {
arg="$@"
dir_path=$(realpath $arg)
if [ "$arg" = '.' ]; then
dir_path="."
fi
start $dir_path
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With