Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

fatal: bad config file line 1 in /home/trx/.gitconfig

Tags:

git

linux

ubuntu

I know this question has been asked a million times, but my ~/.gitconfig consists of only two lines, that are character correct with the tutorial.

git config --global user.name "trx"
git config --global user.email [email protected]

What could be the issue here?

like image 904
Chazt3n Avatar asked Feb 14 '13 14:02

Chazt3n


People also ask

What is ~/ Gitconfig?

The . git/config file in each repository is used to store the configuration for that repository, and $HOME/. gitconfig is used to store a per-user configuration as fallback values for the . git/config file. The file /etc/gitconfig can be used to store a system-wide default configuration.

What should be in my Gitconfig file?

gitconfig) should really contain the settings that apply to ALL your repositories. Primarily things like user.name , user. email , core. editor , merge , and diff should be pretty consistently set.

Where is my Gitconfig file?

gitconfig located in the user's home folder (C:\Users\git user) Local Git configuration: File named config in the . git folder of the local repo.

Why is there no Gitconfig file?

The reason they can't find gitconfig is simply because it's nowhere to be found. When developers install Git, the various Git configuration files won't automatically create. Files like gitconfig and . gitconfig are only created when they're first used.


2 Answers

This is my ~/.gitconfig:

[user]
    name = Luigi R. Viggiano
    email = luigi.viggiano@...
[color]
    ui = true
[merge]
    tool = p4merge
[diff]
    tool = p4merge
[push]
    default = simple

your ~/.gitconfig is not in the correct format.

You don't need to put the commands:

git config --global user.name "trx"
git config --global user.email [email protected]

in a file... you need to type them at the terminal.

Delete your ~/.gitconfig and manipulate it using the git config command at the terminal, as explained in the tutorial.

like image 112
Luigi R. Viggiano Avatar answered Sep 19 '22 12:09

Luigi R. Viggiano


These git config lines are commands that you should run, not the contents for the config file.

like image 30
wRAR Avatar answered Sep 17 '22 12:09

wRAR