Skip to content

Instantly share code, notes, and snippets.

@Nargonath
Last active September 18, 2020 06:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nargonath/1543d112f0cfd072c9121228dce1bf47 to your computer and use it in GitHub Desktop.
Save Nargonath/1543d112f0cfd072c9121228dce1bf47 to your computer and use it in GitHub Desktop.
Gathering of Git knowledge

Alias

  • git config --global alias.fwl "push --force-with-lease"
  • git config --global alias.rh "reset HEAD"
  • git config --global alias.pr "pull --rebase"
  • git config --global alias.cd "checkout develop"
  • git config --global alias.amd "commit --amend"
  • git config --global alias.amdne "commit --amend --no-edit"
  • git config --global alias.amda "commit -a --amend"
  • git config --global alias.amdane "commit -a --amend --no-edit"
  • git config --global alias.lg "log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all"
  • git config --global alias.fa "fetch --all"
  • git config --global alias.st "status"

Delete old branches

  • git remote prune origin
  • git branch -vv | grep 'origin/.*: gone]' | awk '{print $1}' | xargs git branch -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment