GitHub Desktop Creates a Nested Repository Folder
Symptom
Using Add local repository → create a repository to turn C:\dev\SecureNomad into a repository created a new subfolder containing only .gitattributes:
C:\dev\SecureNomad\SecurNomad\ ← 1st attempt (typo in Name)
C:\dev\SecureNomad\SecureNomad\ ← 2nd attempt (same result after changing Local path)
Cause
The create a repository dialog creates a new [Name] folder inside [Local path] and creates .git there.
It does not turn an existing folder into a repository.
Fix (what was actually done)
- In File Explorer, check View → Show → Hidden items
- Cut the
.gitfolder and.gitattributesfromC:\dev\SecureNomad\SecureNomad\ - Paste them one level up into
C:\dev\SecureNomad\ - Delete the now-empty
SecureNomadsubfolder - In GitHub Desktop, Remove the old entry → add
C:\dev\SecureNomadwith Add local repository - Commit all files in the Changes tab
Simpler way
If Git for Windows is installed, create the repository from the terminal:
cd /d C:\dev\SecureNomad
git init -b main
Then just add it in GitHub Desktop with Add local repository.