Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialhum4n01d
25,493 PointsGit init failed
I tried to run git init
in my terminal within a folder and I got this error message:
$ git init
error: Malformed value for push.default: origin
error: Must be one of nothing, matching, simple, upstream or current.
fatal: bad config variable ‘push.default’ in file ‘/Users/Me/.gitconfig' at line 9
$
Not sure what’s going on. Thanks!
2 Answers
Nate Meyer
3,887 PointsThe error is actually saying exactly what the problem is:
fatal: bad config variable ‘push.default’ in file '/Users/Me/.gitconfig' at line 9
It's the .gitconfig file in your home directory.
error: Malformed value for push.default: origin error: Must be one of nothing, matching, simple, upstream or current.
You have "origin" set for push.default and the only valid values are "nothing, matching, simple, upstream or current."
James Gill
Courses Plus Student 34,936 PointsIt's likely caused by having two different versions of Git installed. It's a known issue.
Often, this will fix the issue:
git config --global push.default matching
hum4n01d
25,493 PointsI think I just accidentally changed a setting, thank though
hum4n01d
25,493 Pointshum4n01d
25,493 PointsNate Meyer
Do you mean Users/Me?
Also, which of the options for default are default? That sounds funny :D
Nate Meyer
3,887 PointsNate Meyer
3,887 Points64yes on Treehouse -- yep,
/Users/Me/.gitconfig
. Mine is set tosimple
which is probably the default since I haven't intentionally changed it.hum4n01d
25,493 Pointshum4n01d
25,493 PointsOk, that’s what I got from stackoverflow. :)