foundry icon indicating copy to clipboard operation
foundry copied to clipboard

Remove git config --global requirements from forge

Open activate-glacier-instinct opened this issue 2 years ago • 4 comments

Component

Forge

Describe the feature you would like

Being able to run forge init on a system that does not have global git settings configured.

Requested behaviour

  1. Test git settings
git config --list | grep 'user.'       // Outputs nothing

  1. Forge init
forge init hello_foundry             // Creates the project

Current behaviour

  1. Test git settings
git config --list | grep 'user.'       // Outputs nothing

  1. Forge init
forge init hello_foundry    

Output:

Initializing /home/USER/foundry/hello_foundry...
Error: 
Author identity unknown

*** 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: unable to auto-detect e-mail address (got 'USER')


Additional context

Background Most of my crypto work is anon, so I don't globally set my git credentials. I set them up per repo using scripts.

This is the reason why I'm running the above command in an empty folder.

Setting up a foundry project within a pre-initialised repo also doesn't work. More on that here: https://github.com/foundry-rs/foundry/issues/4214