nix flake init: Use git add --force

This commit is contained in:
Eelco Dolstra 2020-06-23 16:25:32 +02:00
parent 334e26bfc2
commit 09fc06daab

View file

@ -589,7 +589,7 @@ struct CmdFlakeInitCommon : virtual Args, EvalCommand
copyDir(templateDir, flakeDir);
if (pathExists(flakeDir + "/.git")) {
Strings args = { "-C", flakeDir, "add", "--intent-to-add", "--" };
Strings args = { "-C", flakeDir, "add", "--intent-to-add", "--force", "--" };
for (auto & s : files) args.push_back(s);
runProgram("git", true, args);
}