Git for Windows equivalent for open current directory command

*爱你&永不变心* 提交于 2019-12-08 07:00:48

问题


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.


回答1:


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.




回答2:


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.




回答3:


On my native Linux system you'd simply call

gnome-terminal .

or

konsole

or

xterm

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



来源:https://stackoverflow.com/questions/30442535/git-for-windows-equivalent-for-open-current-directory-command

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!