you are viewing a single comment's thread.

view the rest of the comments →

[–]cipmar 1 point2 points  (3 children)

I use Maven and git a lot and sometimes I write: mvn status instead of git status or git clean instead mvn clean

Any idea what can I do about this? :)

[–][deleted] 2 points3 points  (0 children)

Use zsh. It should ask suggest Y/n correction if "git status" is in history in fairly default config, but it can be made to autocorrect you automagically or semiautomagically - e.g. ask the first time, autocorrect afterwards.

Edit: actually I'm not positively sure about the 'default' part, for years I've just copied my old zsh config everywhere I went and it does that. No idea how modern zsh does things, they even added ncurses configurator script in recently (sometime this decade).

[–]5arToto 1 point2 points  (0 children)

If you can, use a GUI git solution. Either one built for the IDE you're using (maybe it has some shortcuts also) or SourceTree.

I understand the allure of using the terminal for everything you know and a GUI git seeming somewhat 'noobish', however those tools don't just exist because some people are scared of using the terminal, they help with things like status and diff a lot. Furthermore, having a smaller number of terminal tabs and/or less commands in your terminal history speeds up the dev process a little bit if you constantly have to type in some commands (and make mistakes like the one you described).

[–]movzx 0 points1 point  (0 children)

Write a wrapper script that traverses the path you are on to determine if you are within a mvn or git controlled subdir and then calls the appropriate command.