Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

I maintain a bunch of git aliases in my .gitconfig for my company's rebase based workflow. They cover 90% of my 'dumb' git usages

    synced = pull origin master --rebase. # Update myself with master

    squash = rebase -i origin/master # Let me optionally squash whatever has happened since master

    publish = push origin HEAD --force-with-lease  # Save to orig in (github)

    pub = push origin HEAD --force-with-lease  # Save to origin (github)

    ammend = commit --amend  # I cannot spell this word for the life of me

    amend = commit --amend


If you use zsh and ohmyzsh you have these commands available in `git` plugin with full docs here https://github.com/ohmyzsh/ohmyzsh/blob/master/plugins/git/R...

A must read for every cli git user.


> ammend = commit --amend # I cannot spell this word for the life of me

This reminds me of one of my favorite silly aliases, which requires declarations in both my shell profile and my .gitconfig:

In .bashrc : `alias gits=git`

In .gitconfig : `[alias]` `tatus = status`

This allows me to mistype `git status` as `gits tatus` and brings me a small amount of joy.


I use Oh My ZSH git aliases. Examples:

gcmsg "git commit -m" - Git commit message

gco "git checkout" - Change branch

gd "git diff" - Files differences in staging

gl "git pull" - Pull from remote

gp "git push" - Push to remote

--- Tool looks interesting!


ohmyzsh has git plugin and a few other git-related plugins with these aliases already available https://github.com/ohmyzsh/ohmyzsh/blob/master/plugins/git/R...


I used to use aliases but got frustrated with them when dealing with PRs depending on PRs, so I wrote git-stack [0]. Thought I'd share in case you'd find it useful

[0] https://github.com/epage/git-stack/blob/main/docs/reference....


consider:

[pull] rebase = true # if you're going to do it anyway might as well make it the default

[rebase] autoSquash = true # if you use --fixup commits autoStash = true # save yourself the roundtrip




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: