4 ms·
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"
by madmax108 10y ago
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"
- amelius 10y agoOr how about git commit with a dummy message? :)
- eric_h 10y agoOh 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 :)
- jurie 10y agoLike 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 -
- tfn 10y agoEven better: https://news.ycombinator.com/item?id=5666160 https://news.ycombinator.com/item?id=5666160
- mod 10y agoI use gcm for `git commit -m `, interestingly. I only use a few git aliases, most things I'd rather type out.
- progval 10y agoAliasing gs may be a bad idea, there is actually a command named like that (it's part of GhostScript)
- madmax108 10y agoOf 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 :)
- amyjess 10y agoAm 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.
- Cub3 10y agoI use Git Goodies, great list of aliases - https://github.com/qw3rtman/gg https://github.com/qw3rtman/gg
- jakub_g 10y agoI have a similar set, plus alias goto='git checkout'
- gsmethells 10y agoI 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.