0

I am trying to clone a GitHub repository to a new work laptop running windows 10. I receive this error when running git clone https://url_to_repo.git

fatal: bad config line 1 in file L:/Documents/project/.git/config

I've tried reinstalling git and looking at the .gitconfig file to make sure there aren't any incorrect settings that I can see.

I'm not sure why this would happen because the file it's saying has the issue is generated when cloning the repository.

This is from an enterprise GitHub account - if that makes a difference.

EylM
  • 5,967
  • 2
  • 16
  • 28
iNeedScissors61
  • 191
  • 1
  • 4
  • 16
  • Is you current directory empty ? In that case, `git clone https://url_to_repo.git .` should work. Anyway if due to a local file, try to delete it – Tinmarino Jul 24 '19 at 17:37
  • What if you use it without .git? Are you sure the url is correct? – Christoph Jul 24 '19 at 17:38
  • The directory is empty. I tried @tinmarino suggestion and it gave the same error. What it does is build the .git folder and some of the underlying files/directories and then fails with the above error. @Christoph I tried also without ```.git``` and it gave the same error. – iNeedScissors61 Jul 24 '19 at 17:42
  • Check your global git config https://stackoverflow.com/questions/14876728/fatal-bad-config-file-line-1-in-home-trx-gitconfig also look at https://stackoverflow.com/questions/27073427/github-error-fatal-bad-config-file-line-1-in-git-config-when-in-git-shell/27650758 – EncryptedWatermelon Jul 24 '19 at 18:18
  • @EncryptedWatermelon That first link doesn't help because my global gitconfig file looks just as it should and isn't the one causing problems. If you look at the error it points to the local .config at .git/config file that is created when you clone a repo. Your second link also doesn't help because in that instance the repository has already been created and you can't clone a repository to a directory that already has files in it. – iNeedScissors61 Jul 24 '19 at 18:37

0 Answers0