Skip to content

Instantly share code, notes, and snippets.

@blacknoob20
Forked from Klerith/git-alias.md
Last active December 16, 2024 16:36
Show Gist options
  • Save blacknoob20/a429b76052ed9cc664fbe69f8d2d91ad to your computer and use it in GitHub Desktop.
Save blacknoob20/a429b76052ed9cc664fbe69f8d2d91ad to your computer and use it in GitHub Desktop.
GIT

Comandos GIT

GIT Log

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"

Status

git config --global alias.s "status --short -b"

Alternativa útil de status

git config --global alias.s "status -sb"

List Stagged

git config --global alias.stg "diff --name-only --cached"

Undo Commit

git config --global alias.undo 'reset --soft HEAD^'

Copy clipboard

git config --global alias.clip '!sh -c "git diff --name-only --cached | xclip -selection clipboard"'

Cache credentials

git config --global credential.helper 'cache --timeout=3600'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment