-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitconfig
More file actions
215 lines (182 loc) · 9.29 KB
/
.gitconfig
File metadata and controls
215 lines (182 loc) · 9.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
# =============================================================================
# Git Configuration File
# Author: Andre Essing
# Last Updated: 2026-01-23
# =============================================================================
# -----------------------------------------------------------------------------
# CORE SETTINGS
# Basic Git behavior configuration
# -----------------------------------------------------------------------------
[core]
# Disable automatic line ending conversion (recommended for cross-platform projects)
# Set to 'true' on Windows or 'input' on macOS/Linux if needed
autocrlf = false
# Use VS Code as the default editor for commit messages, rebases, etc.
editor = code --wait
# Improve performance for large repositories
preloadindex = true
fscache = true
# -----------------------------------------------------------------------------
# INIT SETTINGS
# Default settings for new repositories
# -----------------------------------------------------------------------------
[init]
# Use 'main' as the default branch name (modern standard)
defaultBranch = main
# -----------------------------------------------------------------------------
# PULL/PUSH SETTINGS
# Configure default behavior for pull and push operations
# -----------------------------------------------------------------------------
[pull]
# Rebase local commits on top of fetched commits (cleaner history)
# Change to 'false' if you prefer merge commits
rebase = true
[push]
# Only push the current branch to its upstream (safer than 'matching')
default = current
# Automatically set up tracking for new branches
autoSetupRemote = true
# -----------------------------------------------------------------------------
# FETCH SETTINGS
# Configure fetch behavior
# -----------------------------------------------------------------------------
[fetch]
# Automatically prune deleted remote branches on fetch
prune = true
# Also prune deleted tags
pruneTags = true
# -----------------------------------------------------------------------------
# BRANCH SETTINGS
# Branch management configuration
# -----------------------------------------------------------------------------
[branch]
# Sort branches by most recent commit (most active first)
sort = -committerdate
# -----------------------------------------------------------------------------
# ALIASES
# Shorthand commands for common Git operations
# Usage: git <alias> (e.g., 'git st' instead of 'git status')
# -----------------------------------------------------------------------------
[alias]
# === Basic Commands ===
br = branch # List/create/delete branches
ci = commit # Create a commit
cm = commit -m # Commit with inline message
co = checkout # Switch branches or restore files
f = fetch # Download objects from remote
fp = fetch --prune # Fetch and remove deleted remote branches
fap = fetch --all --prune # Fetch all remotes and prune
pl = pull # Fetch and integrate changes
plr = pull --rebase # Pull with rebasing
plnr = pull --no-rebase # Pull without rebasing
ps = push # Upload local commits to remote
st = status # Show working tree status
sb = status -sb # Short status with branch info
# === Diff Commands ===
d = diff # Show unstaged changes
dc = diff --cached # Show staged changes (ready to commit)
changes = diff --name-status -r # List changed files with status
diffstat = diff --stat -r # Summary of changes (insertions/deletions)
dv = difftool -t vimdiff -y # Visual diff using vimdiff
# === Log Commands ===
hist = log --oneline --graph --decorate --all # Visual commit history graph
last = log -1 HEAD --stat # Details of the most recent commit
lc = log ORIG_HEAD.. --stat --no-merges # Show commits since last pull/merge
lg = log -p # Log with full diff output
ll = log --oneline # Compact one-line commit list
llog = log --date=local # Log with local timezone dates
slog = log --graph --all --topo-order --pretty='format:%h %ai %s%d (%an)'
# Pretty log with colors, graph, and relative dates
lp = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
# === Utility Commands ===
gl = config --global -l # List global Git configuration
rv = remote -v # List remote repositories with URLs
who = shortlog -s -- # List contributors by commit count
undo = reset --soft HEAD^ # Undo last commit (keep changes staged)
unstage = reset HEAD -- # Unstage files (opposite of git add)
# === Maintenance Commands ===
# Clean up local branches that have been deleted on remote
# WARNING: This will delete local branches - review before running!
cleanup = "!git fetch --prune && git branch -vv | grep ': gone]' | awk '{print $1}' | xargs -r git branch -d"
# Sync all remotes: fetch, prune, and show status
sync = "!git fetch --all --prune && git status -sb"
# Reset current branch to remote (use with caution!)
sync-hard = "!git fetch --all --prune && git reset --hard origin/$(git branch --show-current)"
# Fetch all and switch to updated main branch
sync-main = "!git fetch --all --prune && git checkout main && git reset --hard origin/main"
# -----------------------------------------------------------------------------
# MERGE SETTINGS
# Configure merge tool and behavior
# -----------------------------------------------------------------------------
[merge]
tool = vscode
# Show original (base) version in conflicts for 3-way merge
conflictstyle = diff3
[mergetool "vscode"]
cmd = "code --wait $MERGED"
[diff]
# Use VS Code as the diff tool
tool = vscode
# Better diff algorithm for more readable output
algorithm = histogram
[difftool "vscode"]
cmd = code --wait --diff $LOCAL $REMOTE
# -----------------------------------------------------------------------------
# GIT LFS (Large File Storage)
# Manages large binary files outside the main repository
# -----------------------------------------------------------------------------
[filter "lfs"]
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
clean = git-lfs clean -- %f
# -----------------------------------------------------------------------------
# USER IDENTITY
# Your name and email for commit attribution
# SECURITY: Using GitHub's noreply email to protect your real email address
# -----------------------------------------------------------------------------
[user]
name = Andre Essing
# GitHub noreply email - keeps your real email private
email = 21235652+aessing@users.noreply.github.com
# SSH signing key (managed by 1Password)
signingkey = ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEHIP1nIC2BEcxQ9u8ONRnyP3Spg2hn2YvQC9xpPVVCO
# -----------------------------------------------------------------------------
# GPG/SSH SIGNING
# Cryptographically sign commits to verify authenticity
# SECURITY: All commits are signed using SSH key via 1Password
# -----------------------------------------------------------------------------
[gpg]
# Use SSH keys for signing (instead of GPG)
format = ssh
[gpg "ssh"]
# 1Password handles SSH key signing
program = "/Applications/1Password.app/Contents/MacOS/op-ssh-sign"
[commit]
# SECURITY: Always sign commits (proves commit authenticity)
gpgsign = true
[tag]
# SECURITY: Also sign tags
gpgsign = true
# -----------------------------------------------------------------------------
# CREDENTIAL MANAGEMENT
# Secure storage of authentication credentials
# -----------------------------------------------------------------------------
[credential]
# Git Credential Manager for secure credential storage
# Using bare command name - Git will find it in PATH (works with any Homebrew prefix)
helper = /usr/local/bin/git-credential-manager
helper = /usr/local/share/gcm-core/git-credential-manager
[credential "https://dev.azure.com"]
useHttpPath = true
# Azure DevOps requires the full URL path for authentication
# -----------------------------------------------------------------------------
# SAFETY SETTINGS
# Prevent accidental data loss
# -----------------------------------------------------------------------------
[transfer]
# Verify data integrity during transfers
fsckobjects = true
[receive]
# Verify data integrity when receiving
fsckObjects = true