0

$ forge init Error: The target directory is a part of or on its own an already initialized git repository, and it requires clean working and staging areas, including no untracked files.

Check the current git repository's status with git status. Then, you can track files with git add ... and then commit them with git commit, ignore them in the .gitignore file, or run this command again with the --no-commit flag.

If none of the previous steps worked, please open an issue at: https://github.com/foundry-rs/foundry/issues/new/choose

3 Answers 3

0

Try running forge init --no-git. Worked in my case

0

Try running forge init --force .

0

Direct Answer:

forge install --no-git

Context:

Referring to foundry docs, it mentioned:

By default, forge init will also initialize a new git repository, install some submodules and create an initial commit message. 
If you do not want this behavior, pass --no-git.

Just pass in --no-git.

So your command becomes forge install --no-git

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.