Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions git/gitconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,25 @@
email = newton30000@gmail.com
signingkey = ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC5wg+V/70kCWSwZ2dS5+ahTAmBT8ql5td3nawixO5YSZpC4ry64fwLWJpZYy5NhsxZ789ZF6SV2Bh865TYX3xBzJ8PidW4Gz2pwBE0oRpz6klNenPyjghmdWDEbCz17aSth1coA4s07gQqOmi1NMmIt6qMSRqrbthHYDO+PcfstoR/uDPZOM+8ttiO0mMe3chDy+DuAnzgHqxnV+JoEU3+u2fNUqqXdNJnrgjedqbPQSQW4/YLByo6RWbraJ1tKazKzy3eRADQYdXbaRJBMSVp13yiMMrPpK/8RooDgB/Tq970eUBvlGhHYSEf3eLCE2s//qosOv53ctPQTSoptZ8ghxDchn29BRT++2lJQOnRCfT+65KUGfKHgp16wJYJcZ6RIY3UBWG62l54EpElxK5KIYTNV8CUgjIXwClSbzRYvn0tXLMs7XbsJdPWTj/A7V1oE//OcQecYPT4Wobfzczs3LE45ri73sDzK37yw4cvN2YP53McvMI3tghrd+X6TL0=


[url "github:"]
InsteadOf = https://github.com/
InsteadOf = git@github.com:

[ghq]
root = ~/develop
root = ~/develop

[core]
excludesfile = ~/.gitignore
attributesfile = ~/.gitattributes
editor = emacs -nw

[gpg]
format = ssh
[gpg "ssh"]
program = /Applications/1Password.app/Contents/MacOS/op-ssh-sign

[commit]
gpgsign = true

# Include common configuration
[include]
path = ~/.gitconfig.d/common.conf

# Include platform-specific configuration
# Users should create a symlink: ~/.gitconfig.d/platform.conf -> macos.conf or linux.conf
[include]
path = ~/.gitconfig.d/platform.conf
53 changes: 53 additions & 0 deletions git/gitconfig.d/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Git Configuration Structure

This directory contains modular Git configuration files that are included by the main `gitconfig` file.

## File Structure

- `common.conf` - Platform-agnostic settings (URL rewriting, pull/push behavior)
- `macos.conf` - macOS-specific settings (1Password SSH signing path)
- `linux.conf` - Linux-specific settings (1Password SSH signing via PATH)
- `no-1password.conf` - Configuration for environments without 1Password
- `platform.conf` - Symlink to the appropriate platform configuration

## Setup Instructions

### For macOS:
```bash
cd ~/.gitconfig.d
ln -sf macos.conf platform.conf
```

### For Linux with 1Password:
```bash
cd ~/.gitconfig.d
ln -sf linux.conf platform.conf
```

### For environments without 1Password:
```bash
cd ~/.gitconfig.d
ln -sf no-1password.conf platform.conf
```

## Features

### URL Rewriting
- Automatically converts HTTPS GitHub URLs to SSH
- Consistent access method across platforms

### 1Password Integration
- macOS: Uses full application path
- Linux: Uses `op-ssh-sign` from PATH
- Fallback: Disables signing if 1Password unavailable

### Platform-Specific Settings
- macOS: `trustctime = false` (HFS+ compatibility)
- Linux: `trustctime = true` (ext4/other filesystems)

## Troubleshooting

If Git signing fails, check:
1. 1Password is installed and SSH agent is enabled
2. The `op-ssh-sign` binary is accessible
3. The correct platform configuration is linked
18 changes: 18 additions & 0 deletions git/gitconfig.d/common.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Common Git configuration that applies to all platforms

# GitHub URL rewriting rules
[url "git@github.com:"]
insteadOf = https://github.com/

[url "git@github.com:"]
insteadOf = github:

# Additional git settings
[pull]
rebase = false

[init]
defaultBranch = main

[push]
default = simple
18 changes: 18 additions & 0 deletions git/gitconfig.d/linux.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Linux-specific Git configuration

# 1Password SSH signing for Linux (if available)
# This assumes op-ssh-sign is in PATH
# If 1Password is not available, SSH signing will be disabled
[gpg "ssh"]
program = op-ssh-sign

# Linux-specific core settings
[core]
trustctime = true

# Alternative configuration without 1Password
# Users can uncomment the lines below if 1Password is not available
# [commit]
# gpgsign = false
# [gpg]
# format = openpgp
9 changes: 9 additions & 0 deletions git/gitconfig.d/macos.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# macOS-specific Git configuration

# 1Password SSH signing for macOS
[gpg "ssh"]
program = /Applications/1Password.app/Contents/MacOS/op-ssh-sign

# macOS-specific core settings
[core]
trustctime = false
13 changes: 13 additions & 0 deletions git/gitconfig.d/no-1password.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Configuration for environments without 1Password

# Disable commit signing when 1Password is not available
[commit]
gpgsign = false

# Use traditional GPG format if needed
[gpg]
format = openpgp

# Core settings for environments without 1Password
[core]
trustctime = true