Skip to content

bug: git init error with unsafe repositories #2115

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Tomsoz opened this issue Apr 27, 2025 · 0 comments
Open

bug: git init error with unsafe repositories #2115

Tomsoz opened this issue Apr 27, 2025 · 0 comments

Comments

@Tomsoz
Copy link

Tomsoz commented Apr 27, 2025

Provide environment information

System:
OS: Windows 11 10.0.22621
CPU: (8) x64 Intel(R) Core(TM) i3-10100F CPU @ 3.60GHz
Memory: 18.12 GB / 31.87 GB
Binaries:
Node: 20.18.2 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.22 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 11.2.0 - C:\Program Files\nodejs\npm.CMD
pnpm: 9.15.4 - C:\Program Files\nodejs\pnpm.CMD
bun: 1.2.10 - ~.bun\bin\bun.EXE

Describe the bug

When git init runs in create-t3-app I get the following error message

× Failed: could not initialize git. Update git to the latest version!

My git version is git version 2.49.0.windows.1 so that is not the issue.
The issue is

fatal: detected dubious ownership in repository at 'F:/test/ct3a'
'F:/fdfsd/fdgdfghfdg' is on a file system that does not record ownership
To add an exception for this directory, call:

        git config --global --add safe.directory F:/test/ct3a

It's because the filesystem that it is running on is FAT32 so it doesn't record ownership, this could also technically happen if you try and run a git command in a folder you don't own.

The error message in here could be more clear as this did confuse me for a while.
The message shown is marked as Safeguard, should be unreachable so checking for this specific error type or changing that message to something more clear would be helpful

Reproduction repo

n/a

To reproduce

  1. Format a drive with FAT32
  2. Run pnpm create t3-app@latest
  3. Select Yes for Should we initialize a Git repository and stage the changes?
  4. Wait for the packages to install and you should see the error message
  5. Manually try and run a git command in the project's directory and you will see the real error message.

Additional information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant