本文介绍了无需设置user.email和user.name即可提交的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试这样做

  git commit --author ='Paul Draper< my@email.org> '-m'我的提交信息'

但是我得到了

  ***请告诉我你是谁。 

运行

git config --global user.emailyou@example.com
git config --global user.nameYour Name

来设置您的帐户的默认身份。
省略--global仅在此存储库中设置标识。

我可以设置这些,但我处于共享框中,我必须(想要)

  git config user.name'Paul Draper'
git config user.email'my @ email.org'
git commit -m'我的提交信息'
git config --unset user.name
git config --unset user.email

对于一次提交,这是很多行!



有更简单的方法吗? / />>

, - author 只会覆盖前者。)



所有git命令都带有 -

 在动作动词之前设置临时配置数据的参数,所以这是一个完美的地方。 > git -c user.name ='Paul Draper'-c user.email='my@email.org'commit -m'...'


I try to commit like this

git commit --author='Paul Draper <my@email.org>' -m 'My commit message'

but I get

*** 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.

I can set these, but I am on a shared box, and I would have to (want to) unset them afterwards.

git config user.name 'Paul Draper'
git config user.email 'my@email.org'
git commit -m 'My commit message'
git config --unset user.name
git config --unset user.email

That's a lot of lines for one commit!

Is there shorter way?

解决方案

(This occurred to me after suggesting the long version with the environment variables—git commit wants to set both an author and a committer, and --author only overrides the former.)

All git commands take -c arguments before the action verb to set temporary configuration data, so that's the perfect place for this:

git -c user.name='Paul Draper' -c user.email='my@email.org' commit -m '...'

这篇关于无需设置user.email和user.name即可提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-11 05:49