Install XCode Command-Line Tools.
xcode-select --installGenerate SSH Key and add it to GitHub.
Ensure build tools and curl/git are available.
sudo apt-get update -y
sudo apt-get install -y build-essential ca-certificates curl gitClone this repository into ~/dotfiles
git clone https://github.com/yoskeoka/dotfiles.git ~/dotfiles# Do not override existing dotfiles
bash ~/dotfiles/setup.sh deploy
# Force override existing dotfiles
bash ~/dotfiles/setup.sh -f deploybash ~/dotfiles/setup.sh initializeThis dotfiles setup expects the following include files referenced from ~/.gitconfig.
~/.gitconfig.user(private GitHub account)~/.gitconfig.mf-user(work account forgithub.com/moneyforward)
Create them like this:
cat > ~/.gitconfig.user <<'EOF'
[user]
name = your.name
email = your.private@example.com
EOF
cat > ~/.gitconfig.mf-user <<'EOF'
[user]
name = your.name
email = your.work@moneyforward
EOFSecrets must never be committed to this repository. The shell rc files source a
set of optional files from $HOME instead — if a file is absent it is silently
skipped, so nothing breaks on a fresh machine.
| Shell | Single file | Split per purpose |
|---|---|---|
| zsh / bash | ~/.shrc.local |
~/.config/shell/conf.d/*.sh |
| fish | ~/.config/fish/local.fish |
~/.config/fish/conf.d/*.fish |
~/.shrc.local and ~/.config/shell/conf.d/*.sh are read by both .zshrc and
.bashrc, so keep them POSIX sh compatible. Files in a conf.d directory are
sourced in lexical order; prefix them with a number (10-aws.sh) to control it.
Start with the single file and move to conf.d only once entries pile up:
touch ~/.shrc.local
chmod 600 ~/.shrc.local
cat >> ~/.shrc.local <<'EOF'
export SECRET_VALUE=hogehoge
EOFfish uses a different syntax, so it needs its own file:
mkdir -p ~/.config/fish
touch ~/.config/fish/local.fish
chmod 600 ~/.config/fish/local.fish
echo 'set -gx SECRET_VALUE hogehoge' >> ~/.config/fish/local.fishTwo ordering notes:
- For zsh and bash these files are sourced last, so they can override
anything the tracked rc files set (
PATH, aliases, and so on). - fish auto-sources
conf.d/*.fishbeforeconfig.fish. Put a value inlocal.fishinstead when it has to win overconfig.fish.
Keep these files under $HOME and outside ~/dotfiles. .gitignore also lists
their names as a safety net, and the gitleaks pre-commit hook is a second one.
brew bundle dump -f