Skip to content

Instantly share code, notes, and snippets.

@disouzam
Last active October 23, 2024 23:22
Show Gist options
  • Save disouzam/03779f9c7163b890deb304f293b3e709 to your computer and use it in GitHub Desktop.
Save disouzam/03779f9c7163b890deb304f293b3e709 to your computer and use it in GitHub Desktop.
Useful git configs
[user]
name = Dickson Souza
email = [email protected]
[core]
editor = \"\\Microsoft VS Code\\bin\\code\" --wait
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
excludesfile = ../.vscode/**
longpaths = true
logAllRefUpdates = true
autocrlf = true
[checkout]
defaultremote = fork
[push]
defaultremote = fork
[alias]
all = add .
amend = commit --amend
bb = "!D:/GitHubRepos/Gists/Better-git-branch/better-git-branch.sh"
ce = commit
id = log --pretty=format:%h -1
check = diff --check
check-stash = !echo 'Stash content:' && echo '' && git ssh 0 --stat &&echo '' && echo 'Staged content: ' && echo '' && git diff --cached --stat
ci = commit -m
co = checkout
cb = checkout --track
cluntd = clean --dry-run
cluntf = clean -q -f
cpa = cherry-pick --abort
cpc = cherry-pick --continue
cpp = cherry-pick -x
cppd = cherry-pick
cpn = cherry-pick -x --no-commit
cpr = cherry-pick -x --edit
diffA = diff --cached --diff-filter=A -w --unified=0
diffD = diff --cached --diff-filter=D -w --unified=0
diffM = diff --cached --diff-filter=M -w --unified=0
diffWt = diff -w --unified=0
diffStaged = diff --cached -w --unified=0
fe = fetch --prune --prune-tags --verbose
fe2 = fetch --prune --verbose
fl = log --format=oneline
gedit = config --global --edit
ledit = config --local --edit
lo = log --decorate --pretty=medium
lo2 = log --stat --pretty=medium
lo3 = log --stat -p --pretty=medium
logfile = log --pretty=medium -p
lol = log --graph --oneline --decorate
lolAll = log --graph --oneline --branches --all --decorate
lost = fsck --no-reflog
nb = checkout -b
pl = pull
ps = push
pslease = push --force-with-lease
rltag = tag -d
rrtag = push origin --delete
ssh = stash show -u
ssha = stash push --staged
sshl = stash list -p --stat --pretty=medium -n 1 -s --skip
sshlist = stash list --format=oneline
sshlistd = stash list --format=medium
sshp = stash show -u -p
st = status -uall
sts = status -uall -s
stp = status -uall --porcelain=2 --branch
stage = add
stat = diff --cached --stat
summary = log --summary --pretty='1. %Cred**%h**%Creset %s%n%b'
tg = tag -l
tgref = show-ref --tags -s -d
track = push --set-upstream origin
unstage = reset HEAD --
up = !git co && git fe && git pl
[fetch]
prune = true
[log]
abbrevCommit = true
[format]
pretty = 1. %Cred**%h**%Creset %s
[push]
autoSetupRemote = true
[push]
autoSetupRemote = true
[stash]
showIncludeUntracked = true
showPatch = false
showStat = true
[rerere]
enabled = true
[column]
ui = auto
[branch]
sort = -committerdate
[maintenance]
auto = false
strategy = incremental
[merge]
conflictstyle = diff3
@disouzam
Copy link
Author

List of useful git configs I use at work

@disouzam
Copy link
Author

disouzam commented Oct 8, 2023

Added another useful git alias:

track = push --set-upstream origin

@disouzam
Copy link
Author

Set auto setup of local branch:

git config --global push.autoSetupRemote true

@disouzam
Copy link
Author

Diff of the last change:

diff --git a/Useful-git-configs.txt b/Useful-git-configs.txt
index ca260b2..7972738 100644
--- a/Useful-git-configs.txt
+++ b/Useful-git-configs.txt
@@ -6 +5,0 @@
-	check = diff --check
@@ -8 +7 @@
-	co = checkout
+    co = checkout main
@@ -10,2 +8,0 @@
-    cluntd = clean --dry-run
-    cluntf = clean -q -f
@@ -14,2 +11 @@
-    cpr = cherry-pick -x --edit
-    deltag = push --tags --delete
+    cpr = cherry-pick -x
@@ -35,2 +31 @@
-	sshl = stash list -p --stat --pretty=medium -n 1 -s --skip
-    sshp = stash show -u -p
+    sshl = stash list -p -n 1 -s --skip

@disouzam
Copy link
Author

Added e-mail configuration for GitHub repos

@disouzam
Copy link
Author

Aliases were updated in last revision (Revision # 15)

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