类似于sudo的msysGit命令 [英] msysGit sudo-like command

查看:163
本文介绍了类似于sudo的msysGit命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我们以管理员身份打开msysgit,则可以像使用root用户一样使用它.但是,没有管理员权限通常更容易打开.例如,要获得管理员特权,通常必须转到Windows资源管理器,开始"菜单/屏幕等,而不能从任务栏上执行此操作.有时,我懒得做所有这些事情,但是我想在Bash中获得管理员权限. Git Bash是否有类似sudo-或su的命令或脚本等?进入cmd.exePowerShell等,然后再执行runas之类的操作就可以了,如果没有其他要求的话.

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.

推荐答案

您无法从任务栏上完成

you can't do it from the taskbar

您可以:在单击图标的同时按 ctrl + shift ,它将以管理员身份打开.

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

注意: msysgit基于msys ,其中不包含任何类似sudo的命令.

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

评论 .com/users/3513273/aheryan> aheryan ,您可以在搜索时输入 ctrl + shift + enter 从开始菜单 中获取Git Bash:也将以管理员身份启动它.

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.

这篇关于类似于sudo的msysGit命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆