Last active
October 23, 2024 23:22
-
-
Save disouzam/03779f9c7163b890deb304f293b3e709 to your computer and use it in GitHub Desktop.
Useful git configs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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 |
Added another useful git alias:
track = push --set-upstream origin
Set auto setup of local branch:
git config --global push.autoSetupRemote true
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
Added e-mail configuration for GitHub repos
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
List of useful git configs I use at work