Skip to content

Instantly share code, notes, and snippets.

@sidneyspe
Last active November 16, 2025 23:18
Show Gist options
  • Select an option

  • Save sidneyspe/707d3c16a855b53eed25383f7897cc58 to your computer and use it in GitHub Desktop.

Select an option

Save sidneyspe/707d3c16a855b53eed25383f7897cc58 to your computer and use it in GitHub Desktop.
alias for git
[user]
email = your@email.com
name = Your Name
[credential]
helper = store
[color]
branch = auto
diff = auto
status = auto
ui = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
[color "status"]
added = yellow
changed = green
untracked = cyan
[alias]
sync = !git tag -l | xargs git tag -d && git fetch -t
st = status -sb
sf = show --name-only
re = rebase -i HEAD~
caa = commit -a --amend -C HEAD
co = checkout
cc = checkout -b
ci = commit -am
ac = !git add -A && git commit -am
lg = log --pretty=format:'%Cred%h%Creset %C(bold)%cr%Creset %Cgreen<%an>%Creset %s' --max-count=30
lt = describe --tags --abbrev=0
incoming = !(git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' ..@{u})
outgoing = !(git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' @{u}..)
unstage = reset HEAD --
undo = checkout --
rollback = reset --soft HEAD~1
## Aliases for PR's
preparepr = "!f() { BRANCH=$(git rev-parse --abbrev-ref HEAD);git checkout master; git fetch && git rebase; git checkout \"$BRANCH\";git rebase master; }; f"
updatepr = "!f() { BRANCH=$(git rev-parse --abbrev-ref HEAD);git push origin \"$BRANCH\":\"$BRANCH\";}; f"
## Update the org
openpr = "!f() { BRANCH=$(git rev-parse --abbrev-ref HEAD); REPO=$(git ls-remote --get-url | cut -d / -f2 | cut -d . -f1) ;git push --set-upstream origin \"$BRANCH\":\"$BRANCH\"; echo -e \"https://github.com/deco-sites/$REPO/compare/$BRANCH?expand=1\";}; f"
## Aliases that match the hg in / out commands
in = "!f() { BRANCH=$(git rev-parse --abbrev-ref HEAD);git fetch && git log ..origin/\"$BRANCH\"; }; f"
out = "!f() { BRANCH=$(git rev-parse --abbrev-ref HEAD);git fetch && git whatchanged origin/\"$BRANCH\"..; }; f"
[merge]
tool = code
rebase = true
[pull]
rebase = true
[branch]
autosetuprebase = always
[branch "master"]
rebase = true
[core]
eol = lf
autocrlf = input
@sidneyspe
Copy link
Copy Markdown
Author

[user]
email = sidneyspe@gmail.com
name = Sidney Pimentel

[credential]
helper = store

[color]
ui = auto
branch = auto
diff = auto
status = auto

[color "branch"]
current = yellow reverse
local = yellow
remote = green

[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold

[color "status"]
added = yellow
changed = green
untracked = cyan

[alias]
# status/log básicos
st = status -sb
sf = show --name-only

# fluxo de commit
re  = rebase -i HEAD~
caa = commit -a --amend -C HEAD
co  = checkout
cc  = checkout -b
ci  = commit -am
ac  = !git add -A && git commit -am

# logs
lg = log --pretty=format:'%Cred%h%Creset %C(bold)%cr%Creset %Cgreen<%an>%Creset %s' --max-count=30
lt = describe --tags --abbrev=0

# sync de tags
sync = !git tag -l | xargs git tag -d && git fetch -t

# incoming/outgoing “bonitinhos”
incoming = !git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' ..@{u}
outgoing = !git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' @{u}..

# atalhos tipo hg
unstage  = reset HEAD --
undo     = checkout --
rollback = reset --soft HEAD~1

# PR helpers
preparepr = "!f() { \
    BRANCH=$(git rev-parse --abbrev-ref HEAD); \
    git checkout master; \
    git fetch; \
    git rebase; \
    git checkout \"$BRANCH\"; \
    git rebase master; \
}; f"

updatepr = "!f() { \
    BRANCH=$(git rev-parse --abbrev-ref HEAD); \
    git push origin \"$BRANCH\":\"$BRANCH\"; \
}; f"

openpr = "!f() { \
    BRANCH=$(git rev-parse --abbrev-ref HEAD); \
    REPO=$(git ls-remote --get-url | cut -d / -f2 | cut -d . -f1); \
    git push --set-upstream origin \"$BRANCH\":\"$BRANCH\"; \
    echo \"https://github.com/deco-sites/$REPO/compare/$BRANCH?expand=1\"; \
}; f"

in = "!f() { \
    BRANCH=$(git rev-parse --abbrev-ref HEAD); \
    git fetch; \
    git log ..origin/\"$BRANCH\"; \
}; f"

out = "!f() { \
    BRANCH=$(git rev-parse --abbrev-ref HEAD); \
    git fetch; \
    git whatchanged origin/\"$BRANCH\"..; \
}; f"

[merge]
tool = code
rebase = true

[pull]
rebase = true
ff = only

[branch]
autosetuprebase = always

[branch "master"]
rebase = true

[core]
eol = lf
autocrlf = input
safecrlf = false

[init]
defaultBranch = main

[push]
default = current

[fetch]
prune = true

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