Skip to content

Commit e25db39

Browse files
committed
Merge remote-tracking branch 'upstream/main'
* upstream/main: .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 70d952a + 0cd43d1 commit e25db39

File tree

6 files changed

+48
-52
lines changed

6 files changed

+48
-52
lines changed

.exports

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,18 @@
22
export EDITOR='subl -w';
33

44
# Enable persistent REPL history for `node`.
5-
# export NODE_REPL_HISTORY=~/.node_history;
6-
5+
export NODE_REPL_HISTORY=~/.node_history;
76
# Allow 32³ entries; the default is 1000.
8-
# export NODE_REPL_HISTORY_SIZE='32768';
9-
7+
export NODE_REPL_HISTORY_SIZE='32768';
108
# Use sloppy mode by default, matching web browsers.
11-
# export NODE_REPL_MODE='sloppy';
9+
export NODE_REPL_MODE='sloppy';
1210

1311
# Make Python use UTF-8 encoding for output to stdin, stdout, and stderr.
1412
export PYTHONIOENCODING='UTF-8';
1513

1614
# Increase Bash history size. Allow 32³ entries; the default is 500.
1715
export HISTSIZE='32768';
1816
export HISTFILESIZE="${HISTSIZE}";
19-
2017
# Omit duplicates and commands that begin with a space from history.
2118
export HISTCONTROL='ignoreboth';
2219

@@ -36,3 +33,6 @@ export GPG_TTY=$(tty);
3633

3734
# Tell homebrew to not autoupdate every single time I run it (just once a week).
3835
export HOMEBREW_AUTO_UPDATE_SECS=604800
36+
37+
# Hide the “default interactive shell is now zsh” warning on macOS.
38+
export BASH_SILENCE_DEPRECATION_WARNING=1;

.gitconfig

Lines changed: 29 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -10,42 +10,42 @@
1010
# View abbreviated SHA, description, and history graph of the latest 20 commits
1111
l = log --pretty=oneline -n 20 --graph --abbrev-commit
1212

13-
# View the current working tree status using the short format
13+
# View the current working tree status using the short format.
1414
s = status -s
1515

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

19-
# `git di $number` shows the diff between the state `$number` revisions ago and the current state
19+
# `git di $number` shows the diff between the state `$number` revisions ago and the current state.
2020
di = !"d() { git diff --patch-with-stat HEAD~$1; }; git diff-index --quiet HEAD -- || clear; d"
2121

22-
# Pull in remote changes for the current repository and all its submodules
23-
p = git pull --recurse-submodules
22+
# Pull in remote changes for the current repository and all its submodules.
23+
p = pull --recurse-submodules
2424

25-
# Clone a repository including all submodules
25+
# Clone a repository including all submodules.
2626
c = clone --recursive
2727

28-
# Commit all changes
28+
# Commit all changes.
2929
ca = !git add -A && git commit -av
3030

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

3434
# Show verbose output about tags, branches or remotes
3535
tags = tag -l
36-
branches = branch -a
37-
remotes = remote -v
36+
branches = branch --all
37+
remotes = remote --verbose
3838

39-
# List aliases
39+
# List aliases.
4040
aliases = config --get-regexp alias
4141

42-
# Amend the currently staged files to the latest commit
42+
# Amend the currently staged files to the latest commit.
4343
amend = commit --amend --reuse-message=HEAD
4444

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

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

5151
# Remove the old tag with this name and tag the latest commit with it.
@@ -63,48 +63,39 @@
6363
# Find commits by commit message
6464
fm = "!f() { git log --pretty=format:'%C(yellow)%h %Cblue%ad %Creset%s%Cgreen [%cn] %Cred%d' --decorate --date=short --grep=$1; }; f"
6565

66-
# Remove branches that have already been merged with master
66+
# Remove branches that have already been merged with main.
6767
# a.k.a. ‘delete merged’
6868
dm = "!git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d"
6969

70-
# List contributors with number of commits
70+
# List contributors with number of commits.
7171
contributors = shortlog --summary --numbered
7272

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

9276
[apply]
9377
# Detect whitespace errors when applying a patch
9478
whitespace = fix
9579

80+
[branch]
81+
82+
# Show most recently changed branches first.
83+
sort = -committerdate
84+
9685
[core]
86+
# Use Sublime Text as my preferred editor
9787
editor = subl -w
88+
9889
# Use custom `.gitignore` and `.gitattributes`
9990
excludesfile = ~/.gitignore
10091
attributesfile = ~/.gitattributes
10192

102-
# Treat spaces before tabs and all kinds of trailing whitespace as an error
93+
# Treat spaces before tabs and all kinds of trailing whitespace as an error.
10394
# [default] trailing-space: looks for spaces at the end of a line
10495
# [default] space-before-tab: looks for spaces before tabs at the beginning of a line
10596
whitespace = space-before-tab,-indent-with-non-tab,trailing-space
10697

107-
# Make `git rebase` safer on macOS
98+
# Make `git rebase` safer on macOS.
10899
# More info: <http://www.git-tower.com/blog/make-git-rebase-safe-on-osx/>
109100
trustctime = false
110101

@@ -195,3 +186,7 @@
195186

196187
[url "git://gist.github.com/"]
197188
insteadOf = "gist:"
189+
190+
[init]
191+
192+
defaultBranch = main

.macos

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.serve
3636
# defaults write NSGlobalDomain NSTableViewDefaultSizeMode -int 2
3737

3838
# Show scrollbars
39+
# Always show scrollbars
3940
# Possible values: `WhenScrolling`, `Automatic` and `Always`
40-
# defaults write NSGlobalDomain AppleShowScrollBars -string "Automatic"
41+
defaults write NSGlobalDomain AppleShowScrollBars -string "Automatic"
4142

4243
# Disable the over-the-top focus ring animation
4344
# defaults write NSGlobalDomain NSUseAnimatedFocusRing -bool false
@@ -54,14 +55,14 @@ defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
5455
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode2 -bool true
5556

5657
# Expand print panel by default
57-
# defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
58-
# defaults write NSGlobalDomain PMPrintingExpandedStateForPrint2 -bool true
58+
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
59+
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint2 -bool true
5960

6061
# Save to disk (not to iCloud) by default
6162
# defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false
6263

6364
# Automatically quit printer app once the print jobs complete
64-
# defaults write com.apple.print.PrintingPrefs "Quit When Finished" -bool true
65+
defaults write com.apple.print.PrintingPrefs "Quit When Finished" -bool true
6566

6667
# Disable the “Are you sure you want to open this application?” dialog
6768
# defaults write com.apple.LaunchServices LSQuarantine -bool false
@@ -180,13 +181,13 @@ defaults write NSGlobalDomain AppleMetricUnits -bool false
180181
###############################################################################
181182

182183
# Enable lid wakeup
183-
# sudo pmset -a lidwake 1
184+
sudo pmset -a lidwake 1
184185

185186
# Restart automatically on power loss
186-
# sudo pmset -a autorestart 1
187+
sudo pmset -a autorestart 1
187188

188189
# Restart automatically if the computer freezes
189-
# sudo systemsetup -setrestartfreeze on
190+
sudo systemsetup -setrestartfreeze on
190191

191192
# Sleep the display after 15 minutes
192193
# sudo pmset -a displaysleep 15
@@ -341,10 +342,10 @@ defaults write com.apple.finder WarnOnEmptyTrash -bool false
341342
# defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool true
342343

343344
# Show the ~/Library folder
344-
# chflags nohidden ~/Library
345+
chflags nohidden ~/Library && xattr -d com.apple.FinderInfo ~/Library
345346

346347
# Show the /Volumes folder
347-
# sudo chflags nohidden /Volumes
348+
sudo chflags nohidden /Volumes
348349

349350
# Remove Dropbox’s green checkmark icons in Finder
350351
# file=/Applications/Dropbox.app/Contents/Resources/emblem-dropbox-uptodate.icns

.osx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
# 301 https://github.com/mathiasbynens/dotfiles/blob/master/.macos
1+
# 301 https://github.com/mathiasbynens/dotfiles/blob/main/.macos

README.md

Lines changed: 1 addition & 1 deletion
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/mathiasbynens/dotfiles/tarball/master | tar -xzv --strip-components 1 --exclude={README.md,bootstrap.sh,.osx,LICENSE-MIT.txt}
34+
cd; curl -#L https://github.com/mathiasbynens/dotfiles/tarball/main | tar -xzv --strip-components 1 --exclude={README.md,bootstrap.sh,.osx,LICENSE-MIT.txt}
3535
```
3636

3737
To update later on, just run that command again.

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)