msysGit sudo-like command

笑着哭i 提交于 2019-12-22 05:07:44

问题


If we open msysgit as administrator, we can use it as if we were root. However, it is often easier to open without administrator privileges. For example, for administrator privileges, you often have to go to Windows Explorer, the Start menu/screen, etc., and you can't do this from the taskbar. Sometimes, I'm too lazy to do all this, but I want to gain administrator privileges while in Bash. Is there a sudo- or su-like command or script, etc., for Git Bash? Going into cmd.exe, PowerShell, etc., then doing something like runas would work, if there's nothing else.


回答1:


you can't do it from the taskbar

You could though: press ctrl+shift while you are clicking on the icon, and it will open as Administrator.

Note: msysgit is based on msys, which doesn't include any sudo-like command.

As commented by aheryan, you can type ctrl+shift+enter when you're searching for Git Bash from the Start Menu: that will also launch it as Administrator.



来源:https://stackoverflow.com/questions/22767885/msysgit-sudo-like-command

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