Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git create stash without need to configure user.email and user.name (git stash --author ?)

IN SHORT

Is there a possibility to create a stash (using git stash create) without the need to configure user.email and user.name? Something similar to the git commit --author option?

SOME CONTEXT:

I have several build machines on which I have a build user. Each has acces to the central git repositories. However I haven't configured user.email and user.name for each of those users; since they never need to make commits.

In one of my scripts I use

git stash create

(which allows me to use git archive --format-gtz ... I'll spare you the detail; see my related question)

However this command fails:

*** 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 (for <[email protected]>) not allowed
Cannot save the current index state

PS: I have git 1.8.4

like image 882
Chris Maes Avatar asked Apr 22 '16 15:04

Chris Maes


1 Answers

With the git -c flag configuration parameters can be passed on the command line:

git -c user.name=test -c [email protected] stash create
like image 94
Chris Maes Avatar answered Sep 28 '22 03:09

Chris Maes