Skip to content

Commit e4f2cc2

Browse files
authored
Use better git defaults (#1601)
1 parent e0f9bed commit e4f2cc2

2 files changed

Lines changed: 28 additions & 12 deletions

File tree

config/git/config

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# See https://git-scm.com/docs/git-config
2+
3+
[alias]
4+
co = checkout
5+
br = branch
6+
ci = commit
7+
st = status
8+
[init]
9+
defaultBranch = master
10+
[pull]
11+
rebase = true # Rebase (instead of merge) on pull
12+
[push]
13+
autoSetupRemote = true # Automatically set upstream branch on push
14+
[diff]
15+
algorithm = histogram # Clearer diffs on moved/edited lines
16+
colorMoved = plain # Highlight moved blocks in diffs
17+
mnemonicPrefix = true # More intuitive refs in diff output
18+
[commit]
19+
verbose = true # Include diff comment in commit message template
20+
[column]
21+
ui = auto # Output in columns when possible
22+
[branch]
23+
sort = -committerdate # Sort branches by most recent commit first
24+
[tag]
25+
sort = -version:refname # Sort version numbers as you would expect
26+
[rerere]
27+
enabled = true # Record and reuse conflict resolutions
28+
autoupdate = true # Apply stored conflict resolutions automatically

install/config/git.sh

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,3 @@
1-
# Ensure git settings live under ~/.config
2-
mkdir -p ~/.config/git
3-
touch ~/.config/git/config
4-
5-
# Set common git aliases
6-
git config --global alias.co checkout
7-
git config --global alias.br branch
8-
git config --global alias.ci commit
9-
git config --global alias.st status
10-
git config --global pull.rebase true
11-
git config --global init.defaultBranch master
12-
131
# Set identification from install inputs
142
if [[ -n "${OMARCHY_USER_NAME//[[:space:]]/}" ]]; then
153
git config --global user.name "$OMARCHY_USER_NAME"

0 commit comments

Comments
 (0)