linux - git -H 做什么?

标签 linux git

<分区>

我正在使用这个命令:sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production 我是 root 用户,所以我应该也可以在没有 sudo 的情况下使用该命令,但是在我使用没有 sudo 的命令后,Linux 告诉我 -H 是一个未知选项。

最佳答案

它不是 git -H,它是 sudo 的一个选项。读作:

sudo         // This is what we're running
-u git       // Run the command specified later as user "git"
-H bundle    // Set the HOME environment variable to that of user "bundle"
exec rake gitlab:backup:create // The command to execute

如果 sudo 提示它不知道 -H 是什么意思,那可能意味着你有一个旧版本的 sudo不支持它,或者您的 sudo 风格对相同的行为使用不同的命令行选项。我建议检查更新,然后使用 man sudo 检查您在本地运行的确切版本以及它接受的选项。

关于linux - git -H 做什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38631358/

相关文章:

git - pull 请求和分支有什么区别?

git - 我如何识别在 git 提交中添加或删除的文件/目录?

linux - 当我尝试添加一个文件名在 Windows 上无效的文件时,我可以让 git 警告我吗?

database - 如何将数据库置于 git(版本控制)之下?

linux - 如何将 Amazon EC2 Linux DISPLAY 指向我的 Macbook 上的 X11?

c - Linux 下 C 中带 FIFO 的 IPC

linux - for循环linux脚本: Syntax error: Bad for loop variable

c - ext3 linux内核实现

linux - 在平面文件中用单引号括起一个字段

node.js - git 无法提交 - 错误 husky > npm run -s commitmsg