Skip to content

Instantly share code, notes, and snippets.

@cloud-walker
Last active February 17, 2023 13:49
Show Gist options
  • Select an option

  • Save cloud-walker/d1ea925dc24f0901a135c1ffeac5f028 to your computer and use it in GitHub Desktop.

Select an option

Save cloud-walker/d1ea925dc24f0901a135c1ffeac5f028 to your computer and use it in GitHub Desktop.
Awesome GIT

Base configuration

Global for me: add them on ~/.gitconfig

[alias]
  s = status -s
  unstage = reset HEAD --
  last = log -l HEAD
  lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
  branch-name = rev-parse --abbrev-ref HEAD
  publish = !git push -u origin $(git branch-name)
  unpublish = !git push origin :$(git branch-name)

Spawn Env management (

to be added on the .git/config file per project

[alias]
  spawn-publish = "!f() { readonly BRANCH=$(git branch-name) && git checkout -b \"${BRANCH}_spawn_env\" && git publish && git checkout $BRANCH; }; f"
  spawn-update = "!f() { readonly BRANCH=$(git branch-name) && git checkout \"${BRANCH}_spawn_env\" && git rebase $BRANCH && git push -f && git checkout $BRANCH; }; f"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment