我刚刚在我的 CentOS 6 上安装了 git (yum install)。我想克隆一个存储库,但请记住,以 root 用户身份运行 GIT 是不安全的,我尝试以管理员身份执行此操作(我真的不记得其密码)。以下是命令流程。
[root@angkor public_html]# runuser -l admin 'git'
/bin/git: /bin/git: cannot execute binary file
[root@angkor public_html]# su - admin git
Last login: Tue May 28 11:00:08 UTC 2019 on pts/0
/bin/git: /bin/git: cannot execute binary file
[root@angkor public_html]# git
usage: git [--version] [--help] [-c name=value]
[--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
[-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
[--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
<command> [<args>]
正如我们所看到的,当我以 root 身份运行 git 时它启动了,但是当我尝试以管理员身份运行它时报告了一些错误。为什么以及如何修复它?
最佳答案
关于linux - GIT 未在替代用户下运行 -/bin/git :/bin/git: cannot execute binary file,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56341135/