git - how to set push.default in .gitconfig in terminal

in «tip» by Michael Beard
Tags: , , , , ,

There are times, where I want to see what my setting is and others, I need to be able to set to what I want, after it's been reset for me.

What it solved

I've noticed that for whatever reason, there are times where getting git from grid, resets my push.default value in .gitconfig file. Not sure why, but it does. I need to explore this further.

Code or Examples

Here is how to tell what it is set to:

git config --global push.default

and here is how to set it to simple, which is how I usually want it set:

git config --global push.default simple

This usually takes care of the problem.

General Notes

This seems fairly consistent, but it won't update the .gitconfig again, right after doing a pull, so ... I'm not totally sure why it does it in the first place. Maybe I should see if there are global (or local for that matter) git hooks that are being run. That would be annoying.