Skip to content

Commit 7e0323e

Browse files
committed
Merge remote-tracking branch 'upstream/main' into master
* 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 0d30ee8 + 0cd43d1 commit 7e0323e

File tree

6 files changed

+50
-41
lines changed

6 files changed

+50
-41
lines changed

.exports

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

36+
# Hide the “default interactive shell is now zsh” warning on macOS.
37+
export BASH_SILENCE_DEPRECATION_WARNING=1;
38+
3639
# ANDY

.gitconfig

Lines changed: 43 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,59 @@
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=oneline -n 20 --graph --abbrev-commit
55

6+
<<<<<<< HEAD
67
# View the current working tree status using the short format
78
#s = status -s
89
s = status --long
910

1011
# Show the diff between the latest commit and the current state
1112
#d = !"git diff-index --quiet HEAD -- || clear; git --no-pager diff --patch-with-stat"
1213
d = !"clear; git diff"
14+
=======
15+
# View the current working tree status using the short format.
16+
s = status -s
1317

14-
# `git di $number` shows the diff between the state `$number` revisions ago and the current state
18+
# Show the diff between the latest commit and the current state.
19+
d = !"git diff-index --quiet HEAD -- || clear; git --no-pager diff --patch-with-stat"
20+
>>>>>>> upstream/main
21+
22+
# `git di $number` shows the diff between the state `$number` revisions ago and the current state.
1523
di = !"d() { git diff --patch-with-stat HEAD~$1; }; git diff-index --quiet HEAD -- || clear; d"
1624

17-
# Pull in remote changes for the current repository and all its submodules
18-
p = git pull --recurse-submodules
25+
# Pull in remote changes for the current repository and all its submodules.
26+
p = pull --recurse-submodules
1927

28+
<<<<<<< HEAD
2029
# Clone a repository including all submodules
2130
#c = clone --recursive
31+
=======
32+
# Clone a repository including all submodules.
33+
c = clone --recursive
34+
>>>>>>> upstream/main
2235

23-
# Commit all changes
36+
# Commit all changes.
2437
ca = !git add -A && git commit -av
2538

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

2942
# Show verbose output about tags, branches or remotes
3043
tags = tag -l
31-
branches = branch -a
32-
remotes = remote -v
44+
branches = branch --all
45+
remotes = remote --verbose
3346

34-
# List aliases
47+
# List aliases.
3548
aliases = config --get-regexp alias
3649

37-
# Amend the currently staged files to the latest commit
50+
# Amend the currently staged files to the latest commit.
3851
amend = commit --amend --reuse-message=HEAD
3952

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

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

4659
# Remove the old tag with this name and tag the latest commit with it.
@@ -58,29 +71,13 @@
5871
# Find commits by commit message
5972
fm = "!f() { git log --pretty=format:'%C(yellow)%h %Cblue%ad %Creset%s%Cgreen [%cn] %Cred%d' --decorate --date=short --grep=$1; }; f"
6073

61-
# Remove branches that have already been merged with master
74+
# Remove branches that have already been merged with main.
6275
# a.k.a. ‘delete merged’
6376
dm = "!git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d"
6477

65-
# List contributors with number of commits
78+
# List contributors with number of commits.
6679
contributors = shortlog --summary --numbered
6780

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

@@ -114,21 +111,26 @@
114111

115112
[apply]
116113

117-
# Detect whitespace errors when applying a patch
114+
# Detect whitespace errors when applying a patch.
118115
whitespace = fix
119116

117+
[branch]
118+
119+
# Show most recently changed branches first.
120+
sort = -committerdate
121+
120122
[core]
121123

122-
# Use custom `.gitignore` and `.gitattributes`
124+
# Use custom `.gitignore` and `.gitattributes`.
123125
excludesfile = ~/.gitignore
124126
attributesfile = ~/.gitattributes
125127

126-
# Treat spaces before tabs and all kinds of trailing whitespace as an error
128+
# Treat spaces before tabs and all kinds of trailing whitespace as an error.
127129
# [default] trailing-space: looks for spaces at the end of a line
128130
# [default] space-before-tab: looks for spaces before tabs at the beginning of a line
129131
whitespace = space-before-tab,-indent-with-non-tab,trailing-space
130132

131-
# Make `git rebase` safer on macOS
133+
# Make `git rebase` safer on macOS.
132134
# More info: <http://www.git-tower.com/blog/make-git-rebase-safe-on-osx/>
133135
trustctime = false
134136

@@ -176,17 +178,17 @@
176178

177179
[diff]
178180

179-
# Detect copies as well as renames
181+
# Detect copies as well as renames.
180182
renames = copies
181183

182184
[diff "bin"]
183185

184-
# Use `hexdump` to diff binary files
186+
# Use `hexdump` to diff binary files.
185187
textconv = hexdump -v -C
186188

187189
[help]
188190

189-
# Automatically correct and execute mistyped commands
191+
# Automatically correct and execute mistyped commands.
190192
autocorrect = 1
191193

192194
[merge]
@@ -223,6 +225,10 @@
223225

224226
insteadOf = "gist:"
225227

228+
[init]
229+
230+
defaultBranch = main
231+
226232
# ANDY
227233
[credential]
228234

.macos

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ defaults write com.apple.finder WarnOnEmptyTrash -bool false
336336
defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool true
337337

338338
# Show the ~/Library folder
339-
chflags nohidden ~/Library
339+
chflags nohidden ~/Library && xattr -d com.apple.FinderInfo ~/Library
340340

341341
# Show the /Volumes folder
342342
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: 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)