News for hackers. Stuff that matters.
Re:The Fuck – An app which corrects your previous console co... by artursapek on Monday April 17, 2017 @04:15PM (#14134027)
alias gp="git push" has probably saved me hours of my life
Re:The Fuck – An app which corrects your previous console co... by madmax108 on Monday April 17, 2017 @05:07PM (#14134435)
Amen.

My bashrc has so many of these, and they're probably among the most common commands I use daily!:

    alias gs="git status"
    alias gb="git branch"
    alias grh="git reset --hard"
    alias gcdf="git clean -df"
    alias gf="git fetch"
    alias gp="git pull"
    alias gdom="git diff origin/master"
    alias gdomn="git diff --name-status origin/master"
    alias gd="git diff"
    alias gl="git log"
    alias glm="git log --author <my_name>"
    alias gc="git checkout"
    alias gcm="git checkout master"
Re:The Fuck – An app which corrects your previous console co... by gsmethells on Monday April 17, 2017 @08:10PM (#14135526)
I agree, but I am just too lazy for that. Mine are all one char:

  alias b='/usr/local/bin/git checkout -b'
  alias a='/usr/local/bin/git add
  alias d='/usr/local/bin/git diff HEAD'
  alias c='git commit -m'
  alias i='/usr/local/bin/git pull origin'
  alias o='/usr/local/bin/git branch -avv | grep "\*" | cut -d\ -f 2 | xargs -n 1 /usr/local/bin/git push -u origin'
plus:

  alias g='/usr/local/bin/git log --graph --oneline --decorate 
  alias v='/usr/local/bin/git branch -avv'--all'
  alias h='/usr/local/bin/git log -p'
can be useful.
Re:The Fuck – An app which corrects your previous console co... by amyjess on Monday April 17, 2017 @06:00PM (#14134801)
Am I a bad person for creating SVN-style aliases for git?

From my .gitconfig:

    [alias]
            st = status
            ci = "!git add -u && git commit"
            di = diff
I come from an SVN background, I've since switched to Mercurial for my personal projects, and intensely dislike git, but have to use git at work, so I finally said "enough is enough" and made aliases so I can use git like svn/hg.
Re:The Fuck – An app which corrects your previous console co... by mod on Monday April 17, 2017 @05:49PM (#14134729)
I use gcm for `git commit -m `, interestingly.

I only use a few git aliases, most things I'd rather type out.

Re:The Fuck – An app which corrects your previous console co... by Cub3 on Monday April 17, 2017 @06:48PM (#14135091)
I use Git Goodies, great list of aliases - https://github.com/qw3rtman/gg
Re:The Fuck – An app which corrects your previous console co... by progval on Monday April 17, 2017 @05:55PM (#14134774)
Aliasing gs may be a bad idea, there is actually a command named like that (it's part of GhostScript)
Re:The Fuck – An app which corrects your previous console co... by madmax108 on Monday April 17, 2017 @06:50PM (#14135103)
Of course to each his own, but honestly, nothing I work on involves Ghostscript (or Postscript tbh) so not too much of a concern to me.

It's just so much quicker to recall stuff: [g]it [s]tatus :)

Re:The Fuck – An app which corrects your previous console co... by jakub_g on Monday April 17, 2017 @06:57PM (#14135141)
I have a similar set, plus

alias goto='git checkout'

Re:The Fuck – An app which corrects your previous console co... by amelius on Monday April 17, 2017 @05:08PM (#14134442)
Or how about git commit with a dummy message? :)
Re:The Fuck – An app which corrects your previous console co... by eric_h on Monday April 17, 2017 @06:48PM (#14135088)
Oh dear. That reminds me of a story I saw here on HN at some point (might have been in the comments) about a dev team that didn't insist on any commit messages in their VCS, so everyone just put in a '.' to meet the requirement that a commit had to have a message for whatever source control system they were using.

My team doesn't have a strict commit message style guide, but good god it better be at least mildly descriptive of what's in the commit.

(I know you're joking, the thought of a 3 character alias to commit with a dummy message just sent shivers down my spine :)

Re:The Fuck – An app which corrects your previous console co... by jurie on Monday April 17, 2017 @10:08PM (#14135993)
Like this?

  $ cat << EOF > ~/.commit_reasons; strfile ~/.commit_reasons
  Testing...
  %
  Testify...
  %
  Testarossa...
  %
  Does it work yet?
  %
  How bout now?
  %
  Oops.
  %
  Fixed a thing.
  %
  EOF
  
  $ fortune ~/.commit_reasons | cowsay | git -F -
Re:The Fuck – An app which corrects your previous console co... by tfn on Tuesday April 18, 2017 @10:31AM (#14139088)
Re:The Fuck – An app which corrects your previous console co... by jdc0589 on Monday April 17, 2017 @04:20PM (#14134064)
looks like oh-my-zsh ships with this... couldn't figure out why I had it already.