Commit without setting user.email and user.name

Paul Draper :

I try to commit like this

git commit --author='Paul Draper <[email protected]>' -m 'My commit message'

but I get

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

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 '[email protected]'
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?

torek :

(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='[email protected]' commit -m '...'

So in this case -c is part of the git command, not the commit subcommand.

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

check if user name and email in database using expressJS

分類Dev

Retrieving the user name and email id from Facebook into my android app

分類Dev

AWS Cognito - Create user without sending them a verification email

分類Dev

PHP Email a list to user

分類Dev

Setting Up User Permissions

分類Dev

User email not showing in template [METEOR]!

分類Dev

Find user from email address

分類Dev

Setting up sudo access for a user

分類Dev

Display user name in Spring

分類Dev

NSSavePanel name not user editable

分類Dev

Getting the user to name the variables

分類Dev

User Name and Password Generator

分類Dev

user = User.objects.get_or_create(first_name = fk_first_name、last_name = fk_last_name、email = fk_email)[0]なぜ[0]が使用されるのか

分類Dev

Resolving a Slack user ID without mentioning the user

分類Dev

Laravel Auth :: user()-> nameとAuth :: user()-> emailは2つのクエリを実行しますか?

分類Dev

Djoser user activation email POST example

分類Dev

How to disable new user email activation in JHipster ?

分類Dev

User email from GitHub in django social login

分類Dev

Using Django to send Email to a User at a scheduled time

分類Dev

wordpress remove email when user register

分類Dev

Get email from username of user in Phabricator

分類Dev

Facebook connect API : Get user email

分類Dev

WPF user controls and name scoping

分類Dev

OnEdit Function not showing user name

分類Dev

Convert User Input into a List name

分類Dev

Firebase Rest Api setting language for user or app?

分類Dev

Tristate checkbox: deny user from setting it to PartiallyChecked

分類Dev

wp_user_create - Setting a role - Wordpress

分類Dev

reading user define build setting in xcode

Related 関連記事

  1. 1

    check if user name and email in database using expressJS

  2. 2

    Retrieving the user name and email id from Facebook into my android app

  3. 3

    AWS Cognito - Create user without sending them a verification email

  4. 4

    PHP Email a list to user

  5. 5

    Setting Up User Permissions

  6. 6

    User email not showing in template [METEOR]!

  7. 7

    Find user from email address

  8. 8

    Setting up sudo access for a user

  9. 9

    Display user name in Spring

  10. 10

    NSSavePanel name not user editable

  11. 11

    Getting the user to name the variables

  12. 12

    User Name and Password Generator

  13. 13

    user = User.objects.get_or_create(first_name = fk_first_name、last_name = fk_last_name、email = fk_email)[0]なぜ[0]が使用されるのか

  14. 14

    Resolving a Slack user ID without mentioning the user

  15. 15

    Laravel Auth :: user()-> nameとAuth :: user()-> emailは2つのクエリを実行しますか?

  16. 16

    Djoser user activation email POST example

  17. 17

    How to disable new user email activation in JHipster ?

  18. 18

    User email from GitHub in django social login

  19. 19

    Using Django to send Email to a User at a scheduled time

  20. 20

    wordpress remove email when user register

  21. 21

    Get email from username of user in Phabricator

  22. 22

    Facebook connect API : Get user email

  23. 23

    WPF user controls and name scoping

  24. 24

    OnEdit Function not showing user name

  25. 25

    Convert User Input into a List name

  26. 26

    Firebase Rest Api setting language for user or app?

  27. 27

    Tristate checkbox: deny user from setting it to PartiallyChecked

  28. 28

    wp_user_create - Setting a role - Wordpress

  29. 29

    reading user define build setting in xcode

ホットタグ

アーカイブ