Live data from Hacker News

Show HN: I made a tool that made me faster at Git

github.com

131–140 of 235 posts

Re: Show HN: I made a tool that made me faster at Git

#131

Earlier quoted context omitted.

Just change your OS?

I think it kind of proves my point when the solution to not being able to set an editor up is to change your entire OS... (Also: no)

Your OS becomes irrelevant when emacs itself is your OS!

Re: Show HN: I made a tool that made me faster at Git

#132
post #66

> are YOU tired of typing every git command directly into the terminal I'm not. Are there many people that are? Is this not just a matter of learning to use shell keybindings effectively? That and aliases does wonders to avoid repetitive typing. Many times I type `git s` (alias for `git status -s`) out of reflex when I really meant to do `ls`. When I forget to add `-a` to `git ci -m ...` (`ci` being `commit`) and get…

I also aliased git to g, so I can type "g l" for git log.

I also had even shorter shell aliases like gl, but abandoned that. I'm switching shells to often and their configs are constantly out of sync which confuses more than it helps.

Re: Show HN: I made a tool that made me faster at Git

#133

Earlier quoted context omitted.

If you status, commit, diff often then you don't want to leave your editor, because every little things (switching to a terminal just to do git stuff) adds up in the long run. Version control functions should be available right in your editor (e.g. magit) and you can't really beat one character hotkeys for version control stuff. It doesn't get more convenient than that.

Seconding the in-editor approach. Magit is wonderful (though I often do end up heading to the command-line for certain things out of habit).

I think it's good to keep doing some things via command line, so as not to forget how Git works "under the hood". I also keep my Git alias commands to a minimum for a similar reason.

Re: Show HN: I made a tool that made me faster at Git

#135
post #66

> are YOU tired of typing every git command directly into the terminal I'm not. Are there many people that are? Is this not just a matter of learning to use shell keybindings effectively? That and aliases does wonders to avoid repetitive typing. Many times I type `git s` (alias for `git status -s`) out of reflex when I really meant to do `ls`. When I forget to add `-a` to `git ci -m ...` (`ci` being `commit`) and get…

What is ` kF-aa `?

He's referring to the vi command sequence he would type to amend his command, i.e. OP has 'set -o vi' in his shellrc or 'set editing-mode vi' in his inputrc

    # x| = cursor is in insert mode, after char 'x'
    # |x| = cursor is in command mode, on char 'x'
    # () = keystrokes entered resulting in prompt on next line

    $ git ci -m ""|    ()
    $ |                     (k)    # puts shell prompt into command mode () and cycles upwards to previous command (k)
    $ git ci -m "|"|   (F-)        # from current position, reverse search (F) and stop on first occurence of '-'
    $ git ci |-|m ""   (aa)        # cursor is on '-' char, append (a) 'a', i.e. transition into insert mode by advancing cursor after current char, then insert 'a' literally
    $ git ci -a|m ""   ()      # execute command
    $ |

Re: Show HN: I made a tool that made me faster at Git

#136
post #66

> are YOU tired of typing every git command directly into the terminal I'm not. Are there many people that are? Is this not just a matter of learning to use shell keybindings effectively? That and aliases does wonders to avoid repetitive typing. Many times I type `git s` (alias for `git status -s`) out of reflex when I really meant to do `ls`. When I forget to add `-a` to `git ci -m ...` (`ci` being `commit`) and get…

I use zsh + antigen + oh-my-zsh's git plugin which comes with a lot of aliases. For example, `git status` is `gst`: https://github.com/robbyrussell/oh-my-zsh/blob/b6ca933a02ed7...

Re: Show HN: I made a tool that made me faster at Git

#137
post #44

Personally I have been typing all git commands manually into the terminal and never felt a need for GUIs or tools such as this. There are a number of git shortcuts defined in my zsh aliases [0]. It goes like: # Git aliases alias g='git' alias ga='git add' alias ghb='git browse' # hub alias ghpr='git pull-request' # hub alias gp='git push' alias gpoh='git push origin HEAD' ... Using these aliases, we rarely have to ty…

With Mercurial, I like that all commands can be abbreviated to their shortest unique prefix, plus some built-in aliases. So I type a lot of `hg up`, `hg pus`, `hg ci`, `hg pul`, `hg bo`, and so forth. Most of these are almost the same length as your aliases. Whenever I have to touch git and `git co` doesn't work, I think, okay, fine, we'll go through the full dress rehearsal; `git checkout` it is.

Hard to believe how git doesn't have them by default.

Re: Show HN: I made a tool that made me faster at Git

#139
post #130
post #66

> are YOU tired of typing every git command directly into the terminal I'm not. Are there many people that are? Is this not just a matter of learning to use shell keybindings effectively? That and aliases does wonders to avoid repetitive typing. Many times I type `git s` (alias for `git status -s`) out of reflex when I really meant to do `ls`. When I forget to add `-a` to `git ci -m ...` (`ci` being `commit`) and get…

If you editor has a correct git support, you never need to do git status because it will show you which files had been edited since the last commit. Every time I hear people saying how much they prefer the git command line is because they never seriously tried to leverage the git features of their IDE. Vs code with git lens or intellij idea have excellent git integration. Everything is one shortcut away. The git comm…

In my experience of using git integration features in IntelliJ, they are nice for simple tasks like quickly checking the status of a file or committing all the changes, but as soon as I need to do more complex tasks in git, I find the UIs either get in the way and slow me down or just aren’t fully featured enough to do what I need to do and I end up back on the command line. Hence why I always encourage newcomers to git to learn both if possible.

I do agree that git could certainly do with a more consistent command line interface - but I imagine that won’t even be considered until that next major version of git, if it ever arrives.

Re: Show HN: I made a tool that made me faster at Git

#140
post #123
post #75

Earlier quoted context omitted.

Gitlens is incredible. I can't believe none of my coworkers I ever mention it to have used it.

The CodeLens feature in VS2017 is really similar, it's the only reason we pay for the pro license instead of just using community edition.

It's hard to believe MS still charges people who are making their platform more worthy and with competition from Jetbrains.
Post reply on HN