-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitconfig.template
More file actions
33 lines (27 loc) · 1.49 KB
/
.gitconfig.template
File metadata and controls
33 lines (27 loc) · 1.49 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
# Git Configuration Template
# This file is used to generate ~/.gitconfig during setup
# Placeholders: {{REPO_PATH}}, {{HOME_DIR}}
# Include machine-specific configuration (local paths, safe directories, etc.)
[include]
path = ~/.gitconfig.local
# User identification - Customize for your own use
[user]
name = Joey Maffiola
email = 7maffiolajoey@gmail.com
[push]
autoSetupRemote = true
[alias]
# List all aliases
alias = !"command -v python3 >/dev/null && python3 {{REPO_PATH}}/gitconfig_helper.py print_aliases || python {{REPO_PATH}}/gitconfig_helper.py print_aliases"
# Download all remote branches creating local counterparts
branches = "!git fetch && git for-each-ref --format='%(refname:short)' refs/remotes/origin/ | grep -v -e '^origin/HEAD$' -e '^origin$' | while read ref; do git branch --track \"${ref#origin/}\" \"$ref\" 2>/dev/null || true; done"
cleanup = !"command -v python3 >/dev/null && python3 {{REPO_PATH}}/gitconfig_helper.py cleanup \"$@\" || python {{REPO_PATH}}/gitconfig_helper.py cleanup \"$@\""
# Switch to main with error handling: fetch, check for uncommitted changes,
# checkout main, and pull. Detects and reports merge conflicts.
main = !"command -v python3 >/dev/null && python3 {{REPO_PATH}}/gitconfig_helper.py switch_to_main || python {{REPO_PATH}}/gitconfig_helper.py switch_to_main"
# Manage machine-specific git configuration
localconfig = !git config --file ~/.gitconfig.local
[init]
defaultBranch = main
[core]
editor = code --wait