News for hackers. Stuff that matters.
Re:Little Things I Like to Do with Git by fredley on Wednesday May 24, 2017 @10:15AM (#14410140)
Yes, I have similar:

    gs    git status
    gp    git push
    gac   git commit -am 
    gc    git commit
    gcm   git commit -m
    gA    git add -A
    gC    git checkout
    ga    git add
    gd    git diff
    gm    git merge
    gmc   git merge --continue
    gpu   git pull
    grc   git rebase --continue
The only problem is that I cannot use git on anybody else's machine, the muscle memory is too strongly ingrained now. This is a common message:

    The program 'gs' is currently not installed. You can install it by typing:
    sudo apt install ghostscript
Re:Little Things I Like to Do with Git by elcapitan on Wednesday May 24, 2017 @10:17AM (#14410154)
Which is better than if they have the same aliases as you, but they mean something else. I had an interesting time a while ago until I understood that my coworker uses 'st' for stash instead of status.
Re:Little Things I Like to Do with Git by daemin on Wednesday May 24, 2017 @10:35AM (#14410296)
It also means that you can't use any common tools that use the same letters as your shortcuts.
Re:Little Things I Like to Do with Git by fredley on Wednesday May 24, 2017 @10:55AM (#14410428)
True, if I ever need to use ghostscript (whatever it is) in my day-to-day life, it'll be a trainwreck.
Re:Little Things I Like to Do with Git by asdfgadsfgasfdg on Wednesday May 24, 2017 @12:35PM (#14411267)
It's a ps/pdf toolkit type program. It is used by imagemagick as a backend for pdf conversion type stuff - so if you every need imagemagick you might find yourself in for some annoyance as well.
Re:Little Things I Like to Do with Git by hashhar on Wednesday May 24, 2017 @02:56PM (#14412501)
Aliases are only expanded in interactive shells so ImageMagick or any program that calls an executable from within a process will not have any issues.
Re:Little Things I Like to Do with Git by jlgaddis on Wednesday May 24, 2017 @07:30PM (#14414263)
You can, you just have to prefix them with a hyphen, e.g.:

  $ -gs
Re:Little Things I Like to Do with Git by elcapitan on Wednesday May 24, 2017 @02:12PM (#14412151)
I'm actually using them as git aliases, not bash command aliases.
Re:Little Things I Like to Do with Git by danellis on Wednesday May 24, 2017 @11:17AM (#14410611)
How much time does that actually save? I find that for any given task, I spend far more time reading and thinking than I do typing, and of the time spent typing, most of it is spent typing arguments.
Re:Little Things I Like to Do with Git by akavel on Wednesday May 24, 2017 @04:45PM (#14413310)
I use `git diff` and `git log --graph --decorate --all --oneline` and `git status` so often, that it totally saves heaps of time. Especially the second one ― I usually type my `gl` somewhat subconsciously already; only afterwards I realize what I'm looking at, and start reading. That's possibly related to the fact that I commit very often, use many working branches, and then rebase -i (usually squashing and composing a good readable commit message) before publishing.

But anyway, if someone asks for help with "how to fix my mess in git", the absolutely first thing I do is exactly `git log --graph --decorate --all --oneline`, to start finding out visually what the mess actually is.

Re:Little Things I Like to Do with Git by jachee on Wednesday May 24, 2017 @11:32AM (#14410742)
The shorter a command is, the fewer typos can be made. Many times have I typed `git stauts` or `git ocmmit`

Of course, my personal solution instead of aliases was to switch to using SourceTree.

Re:Little Things I Like to Do with Git by herrvogel- on Wednesday May 24, 2017 @03:02PM (#14412563)
I discovered https://github.com/nvbn/thefuck a while ago and now I kind of enjoy making typos like this.
Re:Little Things I Like to Do with Git by fredley on Wednesday May 24, 2017 @11:47AM (#14410879)
For me, at least a day in 5 years: https://xkcd.com/1205/
Re:Little Things I Like to Do with Git by c0achmcguirk on Wednesday May 24, 2017 @12:51PM (#14411425)
I have the exact same alias for git status and I'm very familiar with that error message!

A few more I live and die by:

    gf  git fetch --all; git fetch --tags
    gh  git log --oneline --abbrev-commit --all --graph --decorate
Re:Little Things I Like to Do with Git by akavel on Wednesday May 24, 2017 @04:53PM (#14413382)
IIUC, the --abbrev-commit is unnecessary there, --oneline already does it. Makes the incantation possible to remember and type on a foreign console: "git log --graph --oneline --decorate --all"

edit: yep, per git help log:

  --oneline
    This is a shorthand for "--pretty=oneline --abbrev-commit"
    used together.
Re:Little Things I Like to Do with Git by c0achmcguirk on Wednesday May 24, 2017 @05:46PM (#14413721)
Thanks!
Re:Little Things I Like to Do with Git by piinbinary on Wednesday May 24, 2017 @12:03PM (#14411024)
A few more I find useful:

    gdc      git diff --cached
    gg       git grep -n
    gss      git status -s
    glo      git log --oneline
    gamend   git commit --amend --no-edit
Re:Little Things I Like to Do with Git by henrik_w on Wednesday May 24, 2017 @11:43AM (#14410845)
I have similar aliases and have a similar concern. I usually think "git status" when I type gs. This way I hope I would be able to work without my aliases somewhere else (even though it would take longer since I have to remember to type the whole command).