Chr*_*aes 15 git git-stash git-config
简而言之
是否有可能创建存储(使用git stash create)而无需配置user.email和user.name?类似于git commit --author选项的东西?
一些背景:
我有几个构建机器,我有一个构建用户.每个人都可以访问中央git存储库.但是我还没有配置user.email,并user.name为每个用户; 因为他们永远不需要提交.
在我使用的一个脚本中
git stash create
Run Code Online (Sandbox Code Playgroud)
(这允许我使用git archive --format-gtz ...我将为您提供详细信息;请参阅我的相关问题)
但是此命令失败:
*** Please tell me who you are.
Run
git config --global user.email "you@example.com"
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 (for <macq@chmalap.macqel>) not allowed
Cannot save the current index state
Run Code Online (Sandbox Code Playgroud)
PS:我有git 1.8.4
Chr*_*aes 17
使用git -c标志配置参数可以在命令行上传递:
git -c user.name=test -c user.email=test@test.com stash create
Run Code Online (Sandbox Code Playgroud)
使用 Git 2.21(2019 年第一季度,2 年多后),您无需配置user.email和user.name( git stash --author ?)。
user.useConfigOnly为了创建提交,需要正确配置的用户名/电子邮件;现在“ git stash”(即使它创建提交对象来表示存储条目)命令不受该要求的约束。
请参阅Slavica Djukic (``)的提交 3bc2111(2018 年 11 月 18 日)。
帮助者:Junio C Hamano ( )。(由Junio C Hamano 合并 -- --在提交 1328d29中,2019 年 1 月 4 日)gitster
gitster
stash:容忍丢失用户身份“ ”命令坚持拥有与“ ”和“ ”命令
git stash相同程度的可用用户身份,因为它使用与这些命令相同的创建提交对象的代码路径。git commit-treegit commit这样做并不是绝对必要的。
检查我们是否会在创建提交对象之前呕吐,然后提供假身份来取悦创建提交的机器。
将测试添加到文档中,以确保存储在有或没有有效身份的情况下都能正确执行。这并不是太大的可用性改进,因为运行“
git stash”的用户最终希望通过提交将临时存储在存储中的更改记录在更永久的历史记录中,并且git config user.{name,email}无论如何他们必须在此时执行“”,所以可以说,这种更改只是延迟了在存储库中工作所需的步骤。
| 归档时间: |
|
| 查看次数: |
3868 次 |
| 最近记录: |