DEV Community

Discussion on: What are some things that you don't like about git?

Collapse
 
darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️

why doesn't git commit accept a message by default!?!?

It's bad enough that -m is an option at all; why would that ever be a default?

Collapse
 
pandademic profile image
Pandademic

I just feel we don't need to open $EDITOR every time we want to commit something.

Thread Thread
 
darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️

Technically there's nothing wrong with that, but it is a sign that you might be doing something wrong. If you make a commit, you should be spending some time thinking about what you are doing, what you want to write, and what files are affected.

Having an editor open gives you that time. Using -m on the other hand only discourages writing proper multiline messages when they are actually needed. When you already wrote a summary and notice you might want to add a few more lines, it's way easier if you already have an editor than if you just wrote the whole thing on the commandline and would have to delete it all then reproduce it in the editor.

Thread Thread
 
pandademic profile image
Pandademic

very true... I didn't think of it like that

Collapse
 
damjand profile image
Damjan Dimitrov

This and what @pandademic said can be resolved by creating terminal aliases for specific commands. For example I have git adcom "msg" which is an alias for "git add ." combined with "git commit -m 'msg'"

Thread Thread
 
pandademic profile image
Pandademic

yes(off-topic: we could also use git aliases) , that's what I do @damjand , but I just feel that it would make everyone's life a little easier not to have more aliases to remember.

Thread Thread
 
damjand profile image
Damjan Dimitrov

The point of aliases is not just to have shortcuts but to also make commands that are so short and custom-tailored that you don't even have to remember them like you do for built-in commands :)

Some comments have been hidden by the post's author - find out more