Skip to content
This repository was archived by the owner on Dec 31, 2025. It is now read-only.

Commit 5840bd6

Browse files
committed
Merge branch 'mathiasbynens-main'
* mathiasbynens-main: readme: fix link to lri’s old notes .macos: adjust toolbar title rollover delay .gitconfig: Rely on Git v2.28’s `init.defaultBranch` .gitconfig: delete `mpr` alias .gitconfig: show most recent branches first meta: rename main branch .gitconfig: make `git init` default to `main` instead of `master` (mathiasbynens#926) .gitconfig: improve `git p` alias (mathiasbynens#896) .exports: Hide zsh warning on macOS .macos: fix showing ~/Library folder in macOS 10.15 (Catalina) (mathiasbynens#917)
2 parents fe55222 + e1950c0 commit 5840bd6

File tree

4 files changed

+152
-11
lines changed

4 files changed

+152
-11
lines changed

.exports

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ export MANPAGER='less -X';
1717
export GPG_TTY=$(tty);
1818

1919
# Hide the “default interactive shell is now zsh” warning on macOS.
20-
export BASH_SILENCE_DEPRECATION_WARNING=1;
20+
export BASH_SILENCE_DEPRECATION_WARNING=1;

.gitconfig

Lines changed: 144 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,107 @@
99
[apply]
1010
# Detect whitespace errors when applying a patch
1111
whitespace = fix
12+
[alias]
13+
14+
# View abbreviated SHA, description, and history graph of the latest 20 commits.
15+
l = log --pretty=oneline -n 20 --graph --abbrev-commit
16+
17+
# View the current working tree status using the short format.
18+
s = status -s
19+
20+
# Show the diff between the latest commit and the current state.
21+
d = !"git diff-index --quiet HEAD -- || clear; git --no-pager diff --patch-with-stat"
22+
23+
# `git di $number` shows the diff between the state `$number` revisions ago and the current state.
24+
di = !"d() { git diff --patch-with-stat HEAD~$1; }; git diff-index --quiet HEAD -- || clear; d"
25+
26+
# Pull in remote changes for the current repository and all its submodules.
27+
p = pull --recurse-submodules
28+
29+
# Clone a repository including all submodules.
30+
c = clone --recursive
31+
32+
# Commit all changes.
33+
ca = !git add -A && git commit -av
34+
35+
# Switch to a branch, creating it if necessary.
36+
go = "!f() { git checkout -b \"$1\" 2> /dev/null || git checkout \"$1\"; }; f"
37+
38+
# Show verbose output about tags, branches or remotes
39+
tags = tag -l
40+
branches = branch --all
41+
remotes = remote --verbose
42+
43+
# List aliases.
44+
aliases = config --get-regexp alias
45+
46+
# Amend the currently staged files to the latest commit.
47+
amend = commit --amend --reuse-message=HEAD
48+
49+
# Credit an author on the latest commit.
50+
credit = "!f() { git commit --amend --author \"$1 <$2>\" -C HEAD; }; f"
51+
52+
# Interactive rebase with the given number of latest commits.
53+
reb = "!r() { git rebase -i HEAD~$1; }; r"
54+
55+
# Remove the old tag with this name and tag the latest commit with it.
56+
retag = "!r() { git tag -d $1 && git push origin :refs/tags/$1 && git tag $1; }; r"
57+
58+
# Find branches containing commit
59+
fb = "!f() { git branch -a --contains $1; }; f"
60+
61+
# Find tags containing commit
62+
ft = "!f() { git describe --always --contains $1; }; f"
63+
64+
# Find commits by source code
65+
fc = "!f() { git log --pretty=format:'%C(yellow)%h %Cblue%ad %Creset%s%Cgreen [%cn] %Cred%d' --decorate --date=short -S$1; }; f"
66+
67+
# Find commits by commit message
68+
fm = "!f() { git log --pretty=format:'%C(yellow)%h %Cblue%ad %Creset%s%Cgreen [%cn] %Cred%d' --decorate --date=short --grep=$1; }; f"
69+
70+
# Remove branches that have already been merged with main.
71+
# a.k.a. ‘delete merged’
72+
dm = "!git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d"
73+
74+
# List contributors with number of commits.
75+
contributors = shortlog --summary --numbered
76+
77+
# Show the user email for the current repository.
78+
whoami = config user.email
79+
80+
[apply]
81+
82+
# Detect whitespace errors when applying a patch.
83+
whitespace = fix
84+
85+
[branch]
86+
87+
# Show most recently changed branches first.
88+
sort = -committerdate
89+
90+
[core]
91+
92+
# Use custom `.gitignore` and `.gitattributes`.
93+
excludesfile = ~/.gitignore
94+
attributesfile = ~/.gitattributes
95+
96+
# Treat spaces before tabs and all kinds of trailing whitespace as an error.
97+
# [default] trailing-space: looks for spaces at the end of a line
98+
# [default] space-before-tab: looks for spaces before tabs at the beginning of a line
99+
whitespace = space-before-tab,-indent-with-non-tab,trailing-space
100+
101+
# Make `git rebase` safer on macOS.
102+
# More info: <http://www.git-tower.com/blog/make-git-rebase-safe-on-osx/>
103+
trustctime = false
104+
105+
# Prevent showing files whose names contain non-ASCII symbols as unversioned.
106+
# http://michael-kuehnel.de/git/2014/11/21/git-mac-osx-and-german-umlaute.html
107+
precomposeunicode = false
108+
109+
# Speed up commands involving untracked files such as `git status`.
110+
# https://git-scm.com/docs/git-update-index#_untracked_cache
111+
untrackedCache = true
112+
12113
[color]
13114
branch = auto
14115
diff = auto
@@ -32,14 +133,20 @@
32133
gpgsign = true
33134
template = /Users/thomas.deutsch/.stCommitMsg
34135
[diff]
35-
# Detect copies as well as renames
36-
renames = copies
136+
137+
# Detect copies as well as renames.
138+
renames = copies
139+
37140
[diff "bin"]
38-
# Use `hexdump` to diff binary files
39-
textconv = hexdump -v -C
141+
142+
# Use `hexdump` to diff binary files.
143+
textconv = hexdump -v -C
144+
40145
[help]
41-
# Automatically correct and execute mistyped commands
42-
autocorrect = 1
146+
147+
# Automatically correct and execute mistyped commands.
148+
autocorrect = 1
149+
43150
[merge]
44151
# Include summaries of merged commits in newly created merge commit messages
45152
log = true
@@ -74,5 +181,36 @@
74181
[mergetool "sourcetree"]
75182
cmd = /Applications/Sourcetree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
76183
trustExitCode = true
184+
185+
# URL shorthands
186+
187+
188+
189+
insteadOf = "gh:"
190+
pushInsteadOf = "github:"
191+
pushInsteadOf = "git://github.com/"
192+
193+
[url "git://github.com/"]
194+
195+
insteadOf = "github:"
196+
197+
198+
199+
insteadOf = "gst:"
200+
pushInsteadOf = "gist:"
201+
pushInsteadOf = "git://gist.github.com/"
202+
203+
[url "git://gist.github.com/"]
204+
205+
insteadOf = "gist:"
206+
77207
[init]
208+
209+
defaultBranch = main
210+
78211
templateDir = ~/.git_config/template/
212+
213+
# https://git-scm.com/docs/git-config#git-config-pushdefault
214+
default = simple
215+
# Make `git push` push relevant annotated tags when pushing branches out.
216+
followTags = true

.macos

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,12 @@ defaults write NSGlobalDomain AppleShowScrollBars -string "Always"
3333
# # Disable the over-the-top focus ring animation
3434
# defaults write NSGlobalDomain NSUseAnimatedFocusRing -bool false
3535

36-
# # Disable smooth scrolling
37-
# # (Uncomment if you’re on an older Mac that messes up the animation)
38-
# #defaults write NSGlobalDomain NSScrollAnimationEnabled -bool false
36+
# Adjust toolbar title rollover delay
37+
defaults write NSGlobalDomain NSToolbarTitleViewRolloverDelay -float 0
38+
39+
# Disable smooth scrolling
40+
# (Uncomment if you’re on an older Mac that messes up the animation)
41+
#defaults write NSGlobalDomain NSScrollAnimationEnabled -bool false
3942

4043
# # Increase window resize speed for Cocoa applications
4144
# defaults write NSGlobalDomain NSWindowResizeTime -float 0.001

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ Some of the functionality of these dotfiles depends on formulae installed by `br
9292
* [Cătălin Mariș](https://github.com/alrra) and his [dotfiles repository](https://github.com/alrra/dotfiles)
9393
* [Gianni Chiappetta](https://butt.zone/) for sharing his [amazing collection of dotfiles](https://github.com/gf3/dotfiles)
9494
* [Jan Moesen](http://jan.moesen.nu/) and his [ancient `.bash_profile`](https://gist.github.com/1156154) + [shiny _tilde_ repository](https://github.com/janmoesen/tilde)
95-
* [Lauri ‘Lri’ Ranta](http://lri.me/) for sharing [loads of hidden preferences](http://osxnotes.net/defaults.html)
95+
* Lauri ‘Lri’ Ranta for sharing [loads of hidden preferences](https://web.archive.org/web/20161104144204/http://osxnotes.net/defaults.html)
9696
* [Matijs Brinkhuis](https://matijs.brinkhu.is/) and his [dotfiles repository](https://github.com/matijs/dotfiles)
9797
* [Nicolas Gallagher](http://nicolasgallagher.com/) and his [dotfiles repository](https://github.com/necolas/dotfiles)
9898
* [Sindre Sorhus](https://sindresorhus.com/)

0 commit comments

Comments
 (0)