Skip to content

Commit 8c645c3

Browse files
committed
Merge remote-tracking branch 'upstream/main'
* upstream/main: .gitconfig: exclude submodules 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) .gitconfig: Add `g whoami` README: Fix link (mathiasbynens#902)
2 parents 2bb4dc7 + b7c7894 commit 8c645c3

File tree

6 files changed

+45
-45
lines changed

6 files changed

+45
-45
lines changed

.exports

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,6 @@ export MANPAGER='less -X';
3232
# Avoid issues with `gpg` as installed via Homebrew.
3333
# https://stackoverflow.com/a/42265848/96656
3434
export GPG_TTY=$(tty);
35+
36+
# Hide the “default interactive shell is now zsh” warning on macOS.
37+
export BASH_SILENCE_DEPRECATION_WARNING=1;

.gitconfig

Lines changed: 33 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -5,39 +5,39 @@
55
helper = osxkeychain
66
[alias]
77

8-
# View abbreviated SHA, description, and history graph of the latest 20 commits
8+
# View abbreviated SHA, description, and history graph of the latest 20 commits.
99
l = log --pretty=oneline -n 20 --graph --abbrev-commit
1010

11-
# View the current working tree status using the short format
11+
# View the current working tree status using the short format.
1212
s = status -s
1313

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

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

20-
# Pull in remote changes for the current repository and all its submodules
21-
p = git pull --recurse-submodules
20+
# Pull in remote changes for the current repository and all its submodules.
21+
p = pull --recurse-submodules
2222

23-
# Clone a repository including all submodules
23+
# Clone a repository including all submodules.
2424
c = clone --recursive
2525

26-
# Commit all changes
27-
ca = !git add -A && git commit -av
26+
# Commit all changes.
27+
ca = !git add ':(exclude,attr:builtin_objectmode=160000)' && git commit -av
2828

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

3232
# Show verbose output about tags, branches or remotes
3333
tags = tag -l
34-
branches = branch -a
35-
remotes = remote -v
34+
branches = branch --all
35+
remotes = remote --verbose
3636

37-
# List aliases
37+
# List aliases.
3838
aliases = config --get-regexp alias
3939

40-
# Amend the currently staged files to the latest commit
40+
# Amend the currently staged files to the latest commit.
4141
amend = commit --amend --reuse-message=HEAD
4242

4343
# Checkin
@@ -49,7 +49,7 @@
4949
# Credit an author on the latest commit
5050
credit = "!f() { git commit --amend --author \"$1 <$2>\" -C HEAD; }; f"
5151

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

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

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

74-
# List contributors with number of commits
74+
# List contributors with number of commits.
7575
contributors = shortlog --summary --numbered
7676

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

9380
[apply]
9481

95-
# Detect whitespace errors when applying a patch
82+
# Detect whitespace errors when applying a patch.
9683
whitespace = fix
9784

85+
[branch]
86+
87+
# Show most recently changed branches first.
88+
sort = -committerdate
89+
9890
[core]
9991

100-
# Use custom `.gitignore` and `.gitattributes`
92+
# Use custom `.gitignore` and `.gitattributes`.
10193
excludesfile = ~/.gitignore
10294
attributesfile = ~/.gitattributes
10395

104-
# Treat spaces before tabs and all kinds of trailing whitespace as an error
96+
# Treat spaces before tabs and all kinds of trailing whitespace as an error.
10597
# [default] trailing-space: looks for spaces at the end of a line
10698
# [default] space-before-tab: looks for spaces before tabs at the beginning of a line
10799
whitespace = space-before-tab,-indent-with-non-tab,trailing-space
108100

109-
# Make `git rebase` safer on macOS
101+
# Make `git rebase` safer on macOS.
110102
# More info: <http://www.git-tower.com/blog/make-git-rebase-safe-on-osx/>
111103
trustctime = false
112104

@@ -152,17 +144,17 @@
152144

153145
[diff]
154146

155-
# Detect copies as well as renames
147+
# Detect copies as well as renames.
156148
renames = copies
157149

158150
[diff "bin"]
159151

160-
# Use `hexdump` to diff binary files
152+
# Use `hexdump` to diff binary files.
161153
textconv = hexdump -v -C
162154

163155
[help]
164156

165-
# Automatically correct and execute mistyped commands
157+
# Automatically correct and execute mistyped commands.
166158
autocorrect = 1
167159

168160
[merge]
@@ -203,3 +195,5 @@
203195
rebase = true
204196
[gpg]
205197
program = gpg
198+
[init]
199+
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
@@ -336,7 +339,7 @@ defaults write com.apple.finder WarnOnEmptyTrash -bool false
336339
defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool true
337340

338341
# Show the ~/Library folder
339-
chflags nohidden ~/Library
342+
chflags nohidden ~/Library && xattr -d com.apple.FinderInfo ~/Library
340343

341344
# Show the /Volumes folder
342345
sudo chflags nohidden /Volumes

.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: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ 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.
3838

3939
### Specify the `$PATH`
4040

41-
If `~/.path` exists, it will be sourced along with the other files, before any feature testing (such as [detecting which version of `ls` is being used](https://github.com/mathiasbynens/dotfiles/blob/aff769fd75225d8f2e481185a71d5e05b76002dc/.aliases#L21-26)) takes place.
41+
If `~/.path` exists, it will be sourced along with the other files, before any feature testing (such as [detecting which version of `ls` is being used](https://github.com/mathiasbynens/dotfiles/blob/aff769fd75225d8f2e481185a71d5e05b76002dc/.aliases#L21-L26)) takes place.
4242

4343
Here’s an example `~/.path` file that adds `/usr/local/bin` to the `$PATH`:
4444

@@ -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)