Git for Windows equivalent for open current direct

2019-06-08 04:12发布

I am using the Git for Windows "git bash" command line on Windows and can't seem to find an equivalent in it for the open current directory command "cmd ." I can't find any documentation but if someone can point me to a list of commands for Git for Windows or let me know what the equivalent is I would appreciate it.

3条回答
爷、活的狠高调
2楼-- · 2019-06-08 04:22

Lets say I have a file called index.html and from the command line I want to use a command that would pull up this file up in sublime text which is my default text editor. How would I do that?

Simply define an alias (if you are in a CMD session, started with git-cmd.bat.
In Windows, that would be:

doskey sbt=start "Sublime Text 3" "C:\path\to\Sublime_Text_x64\sublime_text.exe" $*

In a git bash shell:

alias sbt='"/c/path/to/SublimeText/sublime_text.exe"'

Then type sbt yourFile, and it will open directly in Sublime Text.

查看更多
We Are One
3楼-- · 2019-06-08 04:28

If you're using bash under Windows (whether it's installed via a Git installer, Cygwin, or something similar), you should be able to open the current directory in Windows Explorer by typing

cmd /c start .

cmd is the Windows command line program. /c tells it to use use the rest of the command line as a command to be executed. start opens the specified argument; if it's a directory it opens it (by default) in Windows Explorer. You can also use this to open images, documents, and so forth.

查看更多
叛逆
4楼-- · 2019-06-08 04:32

On my native Linux system you'd simply call

gnome-terminal .

or

konsole

or

xterm

I hope MySysGit supports at least one of these...

查看更多
登录 后发表回答