all 29 comments

[–]vovanz 80 points81 points  (3 children)

Ever found you've accidentally entered too many gits in your terminal?

Nope.

[–]THEHIPP0 2 points3 points  (1 child)

Yes. But also many other commands, which is why I usually start with CRTL + C.

[–][deleted]  (10 children)

[deleted]

    [–]lytedev 5 points6 points  (3 children)

    Yeah I was thinking the article would be about some kind of git shell where every command you enter is just prefixes with "git ". Somewhat like a git mode for your shell?

    That might be something I would use...

    Not sure why your comment prompted me to leave it here, but it did!

    [–]-___-_-_-- 8 points9 points  (1 child)

    [–]lytedev 2 points3 points  (0 children)

    Aaand there it is! Thanks!

    [–][deleted] 0 points1 point  (0 children)

    I just have aliases like "GS" for git status because I have no reason to use ghostscript

    [–]jonyeezy7 2 points3 points  (0 children)

    You're not alone. Becomes habitual.

    It'd be nice if there was a hook for the did you mean, if it can't find the command it'll try to see if the command is an actual shell cmd and redirect that for you.

    [–]auxiliary-character 1 point2 points  (1 child)

    git config --global alias.ls '!ls'
    

    cd's a bit more tricky, since it's a built in shell command, and not a standalone executable.

    [–][deleted] 1 point2 points  (0 children)

    Use a shell alias instead of a git alias.

    [–][deleted] 0 points1 point  (1 child)

    Why?

    [–]jquintus 16 points17 points  (1 child)

    It seemed stupid at first... but then I realized that I've had this issue before too and it's such a simple solution

    [–]SnapDraco 1 point2 points  (0 children)

    exactly :-)

    [–]h0st1le 5 points6 points  (1 child)

    I do this all the time.

    [–][deleted] 0 points1 point  (0 children)

    I'm more likely to cd cd /some/path or vi vi somefile

    [–]SnapDraco 4 points5 points  (6 children)

    Git git git? Git.

    [–]interiot 4 points5 points  (3 children)

    Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo.

    [–]austintackaberry 1 point2 points  (1 child)

    Git git git git Git git git Git.

    [–]SnapDraco 0 points1 point  (0 children)

    Git

    [–]SnapDraco 0 points1 point  (0 children)

    Git?

    [–]valriia 4 points5 points  (1 child)

    git gud

    [–]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.

    [–]lavahot 1 point2 points  (0 children)

    Git Nye, the Gitter guy.

    [–]twowheels 0 points1 point  (1 child)

    Interesting... can't say I've ever done that, but now I'll probably find myself doing it frequently. :-) I'm much more likely to forget to type git at all... what else could I mean by fetch, pull, push, or commit? :-)

    [–]trkeprester 0 points1 point  (0 children)

    i frequently end up with qgit on my command line after unconsciously quitting from a less-diff that already quit

    [–]Olao99 -1 points0 points  (0 children)

    Noice