我在Windows中使用Git,并希望通过一次提交将可执行shell脚本推送到git repo.
通常我需要做两个步骤(git commit).
$ vi install.sh
$ git add install.sh
$ git commit -am "add new file for installation" # first commit
[master f2e92da] add support for install.sh
1 files changed, 18 insertions(+), 3 deletions(-)
create mode 100644 install.sh
$ git update-index --chmod=+x install.sh
$ git commit -am "update file permission" # second commit
[master 317ba0c] update file permission
0 files changed
mode change 100644 => 100755 install.sh
Run Code Online (Sandbox Code Playgroud)
如何将这两个步骤合并为一步?git配置?Windows命令?
提醒:两个答案都很好,git add --chmod=+x file新git版本支持
参考: …
这涉及到另外一个问题我最近问存储在Dropbox的非纯仓库的计算机之间轻松移动,因此它可能是有帮助的阅读背景问题.
要点是fileMode不断报告某些文件的差异.我无法找到一种方法来重现它,但它经常发生.我注意到的是,该文件在两台机器上具有644权限,通常会在其中一台机器上报告755的差异.这让我觉得Git认为可执行位已设置,但我无法弄清楚我是否真的可以看到 Git 是如何设置该位的.
按照https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/https-singleinstance-php.html上的说明,我一直在尝试添加 SSL 证书以允许我的单实例环境使用 https 。
我在这上面花了很多时间,这让我发疯。
我的重要发现是:
在重新部署并检查 /etc/httpd/conf.d/ 后,我通过 SSH 连接到 EC2 实例进行测试。
我正在运行的平台:PHP 7.4 running on 64bit Amazon Linux 2/3.1.2
这是我第一次使用 SSL 证书以及 AWS,因此我们将不胜感激。
https-instance.config:
packages:
yum:
mod_ssl: []
files:
/etc/pki/tls/certs/server.crt:
mode: "000400"
owner: root
group: root
content: |
-----BEGIN CERTIFICATE-----
1
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
2
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
3
-----END CERTIFICATE-----
/etc/pki/tls/certs/server.key:
mode: "000400"
owner: root …Run Code Online (Sandbox Code Playgroud) apache deployment config amazon-elastic-beanstalk ebextensions
部署 Elastic Beanstalk 应用程序时,我的一个挂钩因“权限被拒绝”而失败。我得到以下内容/var/log/eb-engine.log:
[信息] 运行平台挂钩:.platform/hooks/predeploy/collectstatic.sh
[错误] 执行命令 [app-deploy] - [RunAppDeployPreDeployHooks] 期间发生错误。停止运行该命令。错误:命令 .platform/hooks/predeploy/predeploy.sh 失败,错误 fork/exec .platform/hooks/predeploy/predeploy.sh:权限被拒绝
我该如何解决?
我有一个在 AWS Linux 1 上运行 Python 3.6 的 Elastic Beanstalk 环境,我想将其切换到 Amazon Linux 2 上的 Python 3.8。
我知道我可以使用 aws CLIupdate-environment命令升级环境:
aws elasticbeanstalk update-environment --environment-name <ENV_NAME> --solution-stack-name "64bit Amazon Linux 2 v3.3.7 running Python 3.8"
Run Code Online (Sandbox Code Playgroud)
但是,AWS Linux 2 使用不同的配置参数。我无法部署 AWS Linux 2 配置,因为它在 AWS Linux 1 上无效,并且我无法升级到 AWS Linux 2,因为我的配置无效。
如何进行升级?有没有办法就地进行升级?
git ×2
apache ×1
config ×1
deployment ×1
diff ×1
dropbox ×1
ebextensions ×1
permissions ×1
python ×1