Skip to content

Commit 66a8904

Browse files
committed
Merge remote-tracking branch 'upstream/main'
* upstream/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 2c83aa4 + 66ba9b3 commit 66a8904

File tree

5 files changed

+48
-61
lines changed

5 files changed

+48
-61
lines changed

.exports

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@ export MANPAGER='less -X';
3333
# https://stackoverflow.com/a/42265848/96656
3434
export GPG_TTY=$(tty);
3535

36-
# React native JS debugger
37-
export REACT_DEBUGGER="open -g 'rndebugger://set-debugger-loc?host=localhost&port=8081' ||"
36+
# Hide the “default interactive shell is now zsh” warning on macOS.
37+
export BASH_SILENCE_DEPRECATION_WARNING=1;

.gitconfig

Lines changed: 39 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,119 +1,99 @@
11
[alias]
22

3-
# View abbreviated SHA, description, and history graph of the latest 20 commits
3+
# View abbreviated SHA, description, and history graph of the latest 20 commits.
44
l = log --pretty=format:'%C(magenta)%G? %C(auto)%h %d %s' -n 20 --graph --abbrev-commit
55

6-
# View the current working tree status using the short format
6+
# View the current working tree status using the short format.
77
s = status -s
88

9-
# Full status
9+
# Full status.
1010
st = status
1111

12-
# Show the diff between the latest commit and the current state
12+
# Show the diff between the latest commit and the current state.
1313
d = !"git diff-index --quiet HEAD -- || clear; git --no-pager diff --patch-with-stat"
1414

15-
# Pull in remote changes for the current repository and all its submodules
16-
p = git pull --recurse-submodules
17-
18-
# `git di $number` shows the diff between the state `$number` revisions ago and the current state
15+
# `git di $number` shows the diff between the state `$number` revisions ago and the current state.
1916
di = !"d() { git diff --patch-with-stat HEAD~$1; }; git diff-index --quiet HEAD -- || clear; d"
2017

21-
# Pull in remote changes for the current repository and all its submodules
22-
p = git pull --recurse-submodules
18+
# Pull in remote changes for the current repository and all its submodules.
19+
p = pull --recurse-submodules
2320

24-
# Clone a repository including all submodules
21+
# Clone a repository including all submodules.
2522
c = clone --recursive
2623

27-
# Commit all changes
24+
# Commit all changes.
2825
ca = !git add -A && git commit -av
2926

30-
# Switch to a branch, creating it if necessary
27+
# Switch to a branch, creating it if necessary.
3128
go = "!f() { git checkout -b \"$1\" 2> /dev/null || git checkout \"$1\"; }; f"
3229

33-
# Checkout
30+
# Checkout.
3431
co = checkout
3532

36-
# Show verbose output about tags, branches or remotes
33+
# Show verbose output about tags, branches or remotes.
3734
tags = tag -l
3835
branches = branch -a
3936
remotes = remote -v
4037

41-
# List aliases
38+
# List aliases.
4239
aliases = config --get-regexp alias
4340

44-
# Amend the currently staged files to the latest commit
41+
# Amend the currently staged files to the latest commit.
4542
amend = commit --amend --reuse-message=HEAD
4643

47-
# Credit an author on the latest commit
44+
# Credit an author on the latest commit.
4845
credit = "!f() { git commit --amend --author \"$1 <$2>\" -C HEAD; }; f"
4946

50-
# Interactive rebase with the given number of latest commits
47+
# Interactive rebase with the given number of latest commits.
5148
reb = "!r() { git rebase -i HEAD~$1; }; r"
5249

5350
# Remove the old tag with this name and tag the latest commit with it.
5451
retag = "!r() { git tag -d $1 && git push origin :refs/tags/$1 && git tag $1; }; r"
5552

56-
# Find branches containing commit
53+
# Find branches containing commit.
5754
fb = "!f() { git branch -a --contains $1; }; f"
5855

59-
# Find tags containing commit
56+
# Find tags containing commit.
6057
ft = "!f() { git describe --always --contains $1; }; f"
6158

62-
# Find commits by source code
59+
# Find commits by source code.
6360
fc = "!f() { git log --pretty=format:'%C(yellow)%h %Cblue%ad %Creset%s%Cgreen [%cn] %Cred%d' --decorate --date=short -S$1; }; f"
6461

65-
# Find commits by commit message
62+
# Find commits by commit message.
6663
fm = "!f() { git log --pretty=format:'%C(yellow)%h %Cblue%ad %Creset%s%Cgreen [%cn] %Cred%d' --decorate --date=short --grep=$1; }; f"
6764

68-
# Remove branches that have already been merged with master
65+
# Remove branches that have already been merged with main.
6966
# a.k.a. ‘delete merged’
7067
dm = "!git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d"
7168

7269
# List contributors with number of commits
7370
contributors = shortlog --summary --numbered
7471

75-
# Merge GitHub pull request on top of the current branch or,
76-
# if a branch name is specified, on top of the specified branch
77-
mpr = "!f() { \
78-
declare currentBranch=\"$(git symbolic-ref --short HEAD)\"; \
79-
declare branch=\"${2:-$currentBranch}\"; \
80-
if [ $(printf \"%s\" \"$1\" | grep '^[0-9]\\+$' > /dev/null; printf $?) -eq 0 ]; then \
81-
git fetch origin refs/pull/$1/head:pr/$1 && \
82-
git checkout -B $branch && \
83-
git rebase $branch pr/$1 && \
84-
git checkout -B $branch && \
85-
git merge pr/$1 && \
86-
git branch -D pr/$1 && \
87-
git commit --amend -m \"$(git log -1 --pretty=%B)\n\nCloses #$1.\"; \
88-
fi \
89-
}; f"
90-
9172
# Show the user email for the current repository.
9273
whoami = config user.email
9374

94-
# Amazon recommended alias setup
95-
dag = log --graph --format='format:%C(yellow)%h%C(reset) %C(blue)%an <%ae>%C(reset) %C(magenta)%cr%C(reset)%C(auto)%d%C(reset)%n%s' --date-order
96-
97-
# Show the user email for the current repository.
98-
whoami = config user.email
99-
10075
[apply]
10176

102-
# Detect whitespace errors when applying a patch
77+
# Detect whitespace errors when applying a patch.
10378
whitespace = fix
10479

80+
[branch]
81+
82+
# Show most recently changed branches first.
83+
sort = -committerdate
84+
10585
[core]
10686

107-
# Use custom `.gitignore` and `.gitattributes`
87+
# Use custom `.gitignore` and `.gitattributes`.
10888
excludesfile = ~/.gitignore
10989
attributesfile = ~/.gitattributes
11090

111-
# Treat spaces before tabs and all kinds of trailing whitespace as an error
91+
# Treat spaces before tabs and all kinds of trailing whitespace as an error.
11292
# [default] trailing-space: looks for spaces at the end of a line
11393
# [default] space-before-tab: looks for spaces before tabs at the beginning of a line
11494
whitespace = space-before-tab,-indent-with-non-tab,trailing-space
11595

116-
# Make `git rebase` safer on macOS
96+
# Make `git rebase` safer on macOS.
11797
# More info: <http://www.git-tower.com/blog/make-git-rebase-safe-on-osx/>
11898
trustctime = false
11999

@@ -125,7 +105,7 @@
125105
# https://git-scm.com/docs/git-update-index#_untracked_cache
126106
untrackedCache = true
127107

128-
# Amazon recommended pager config
108+
# Recommended pager config
129109
pager = less -FMRiX
130110

131111
[color]
@@ -160,22 +140,22 @@
160140

161141
[diff]
162142

163-
# Detect copies as well as renames
143+
# Detect copies as well as renames.
164144
renames = copies
165145

166146
[diff "bin"]
167147

168-
# Use `hexdump` to diff binary files
148+
# Use `hexdump` to diff binary files.
169149
textconv = hexdump -v -C
170150

171151
[help]
172152

173-
# Automatically correct and execute mistyped commands
153+
# Automatically correct and execute mistyped commands.
174154
autocorrect = 1
175155

176156
[merge]
177157

178-
# Include summaries of merged commits in newly created merge commit messages
158+
# Include summaries of merged commits in newly created merge commit messages.
179159
log = true
180160

181161
[push]
@@ -206,3 +186,7 @@
206186
[url "git://gist.github.com/"]
207187

208188
insteadOf = "gist:"
189+
190+
[init]
191+
192+
defaultBranch = main

.macos

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ defaults write NSGlobalDomain AppleShowScrollBars -string "Always"
4141
# Disable the over-the-top focus ring animation
4242
defaults write NSGlobalDomain NSUseAnimatedFocusRing -bool false
4343

44+
# Adjust toolbar title rollover delay
45+
defaults write NSGlobalDomain NSToolbarTitleViewRolloverDelay -float 0
46+
4447
# Disable smooth scrolling
4548
# (Uncomment if you’re on an older Mac that messes up the animation)
4649
# defaults write NSGlobalDomain NSScrollAnimationEnabled -bool false
@@ -378,7 +381,7 @@ defaults write com.apple.finder WarnOnEmptyTrash -bool false
378381
defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool true
379382

380383
# Show the ~/Library folder
381-
chflags nohidden ~/Library
384+
chflags nohidden ~/Library && xattr -d com.apple.FinderInfo ~/Library
382385

383386
# Show the /Volumes folder
384387
sudo chflags nohidden /Volumes

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ set -- -f; source bootstrap.sh
3131
To install these dotfiles without Git:
3232

3333
```bash
34-
cd; curl -#L https://github.com/dmcass/dotfiles/tarball/master | tar -xzv --strip-components 1 --exclude={README.md,bootstrap.sh,.osx,LICENSE-MIT.txt}
34+
cd; curl -#L https://github.com/dmcass/dotfiles/tarball/master | tar -xzv --strip-components 1 --exclude={README.md,bootstrap.sh,LICENSE-MIT.txt}
3535
```
3636

3737
To update later on, just run that command again.
@@ -101,7 +101,7 @@ Suggestions/improvements
101101
* [Cătălin Mariș](https://github.com/alrra) and his [dotfiles repository](https://github.com/alrra/dotfiles)
102102
* [Gianni Chiappetta](https://butt.zone/) for sharing his [amazing collection of dotfiles](https://github.com/gf3/dotfiles)
103103
* [Jan Moesen](http://jan.moesen.nu/) and his [ancient `.bash_profile`](https://gist.github.com/1156154) + [shiny _tilde_ repository](https://github.com/janmoesen/tilde)
104-
* [Lauri ‘Lri’ Ranta](http://lri.me/) for sharing [loads of hidden preferences](http://osxnotes.net/defaults.html)
104+
* Lauri ‘Lri’ Ranta for sharing [loads of hidden preferences](https://web.archive.org/web/20161104144204/http://osxnotes.net/defaults.html)
105105
* [Matijs Brinkhuis](https://matijs.brinkhu.is/) and his [dotfiles repository](https://github.com/matijs/dotfiles)
106106
* [Nicolas Gallagher](http://nicolasgallagher.com/) and his [dotfiles repository](https://github.com/necolas/dotfiles)
107107
* [Sindre Sorhus](https://sindresorhus.com/)

bootstrap.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
cd "$(dirname "${BASH_SOURCE}")";
44

5-
git pull origin master;
5+
git pull origin main;
66

77
function doIt() {
88
rsync --exclude ".git/" \

0 commit comments

Comments
 (0)