Skip to content

Instantly share code, notes, and snippets.

@paulz
Last active June 11, 2025 21:38
Show Gist options
  • Save paulz/bef72d30d483008f53717f31d153000f to your computer and use it in GitHub Desktop.
Save paulz/bef72d30d483008f53717f31d153000f to your computer and use it in GitHub Desktop.
git aliases I often use
# Here is how to set up often used aliases:
#
# alias.co checkout
# alias.st status
# alias.amend commit --amend -C HEAD
#
git config --global alias.amend "commit --amend -C HEAD"
git config --global alias.st status
git config --global alias.co checkout
git config --global pager.tag false
alias.co checkout
alias.st status
alias.amend commit --amend -C HEAD
@paulz
Copy link
Author

paulz commented Nov 1, 2016

Here is how to set them up:

git config --global alias.amend "commit --amend -C HEAD"
git config --global alias.st status
git config --global  alias.co checkout

@paulz
Copy link
Author

paulz commented Aug 10, 2018

git config --global push.default current

to enable git push without failures like

fatal: The current branch experiment has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream origin experiment

@paulz
Copy link
Author

paulz commented Jul 29, 2022

what alias could this be? git reset --hard @{u}

@paulz
Copy link
Author

paulz commented Aug 18, 2022

git config --global alias.reset-remote "reset --hard @{u}"

@paulz
Copy link
Author

paulz commented Aug 23, 2022

git push -u origin head

@paulz
Copy link
Author

paulz commented Jun 11, 2025

Make git tag just list tags

https://gist.github.com/paulz/bef72d30d483008f53717f31d153000f#file-add-aliases-sh-L10

This makes git tag show short list immediately, while git log shows recent on top.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment