DEV Community

TK
TK

Posted on

I did an inventory of .gitconfig

Introduction

I've been using .gitconfig settings as they were given to me by a senior colleague, and I decided it was time to understand them, so I conducted an inventory.

Result

git config

What's left

After the inventory the size of the config became very small and now I know what I set up 🙌✨

user

It's mandatory.

core

quotepath = false

I am Japanese and this setting is to prevent garbled file names containing Japanese characters.

https://git-scm.com/docs/git-config#Documentation/git-config.txt-corequotePath

fetch

prune = true

This is convenient to have.
When you git fetch, it will reflect a branch deleted in a remote repository in the local repository.

https://git-scm.com/docs/git-config#Documentation/git-config.txt-fetchprune

pull

ff = only

This is the safest option.
Merge only if fast-forward, otherwise merge is not performed and an error occurs.

https://git-scm.com/docs/git-config#Documentation/git-config.txt-pullff

push

default = current

For me, the remote branches always have the same name.
So this setting is handy that it push the current branch to the remote with the same name and even if upstream is not set, it will be pushed.

https://git-scm.com/docs/git-config#Documentation/git-config.txt-pushdefault

What's removed

alias

I had so many alias that I never used.
As I was deleting unnecessary aliases, I started thinking that I didn't need aliases in the first place and deleted them all. I guess I am a clean-freak.

default settings

There were a few settings that were already defaulted by git, so I excluded those as well.

Top comments (0)