如何在AWS Lambda中设置git config

问题描述 投票:0回答:1

我需要在aws lambda中使用git。但是,git commit -m "comment"失败,出现以下错误:

error: *** Please tell me who you are.
Run

git config --global user.email "[email protected]"
git config --global user.name "Your Name"

to set your account's default identity.

Omit --global to set the identity only in this repository.
fatal: empty ident name not allowed

我在配置用户名和电子邮件中添加了以下代码

git.exec_command('config', 'user.name', '--local', '"name"')
git.exec_command('config', 'user.email', '--local', '"[email protected]"')

失败:

error: could not lock config file .git/config: No such file or directory

原因是因为lambda中没有.git/config

我的问题是如何将git配置文件设置为lambda中的自定义文件?

python git amazon-web-services aws-lambda
1个回答
0
投票

完全使用配置文件的替代方法是像-c一样使用git -c user.email='[email protected]' -c user.name='xxx' commit -m 'comment'

© www.soinside.com 2019 - 2024. All rights reserved.