Personal Repository Setup
When using AlignTrue in team mode, you may want to keep some rules private while still version controlling them. This guide shows you how to set up a remote repository for your personal rules.
Why Use a Personal Remote?
In team mode, personal rules cannot be stored in the main repository (to prevent leaking private information). You have two options:
- Local only - Rules stay on your machine (not version controlled)
- Remote - Rules sync to a private git repository (version controlled)
Using a remote gives you:
- Version history for your personal rules
- Backup in case of machine failure
- Ability to sync across multiple machines
- Same git workflow you’re used to
Prerequisites
- A git hosting account (GitHub, GitLab, Bitbucket, etc.)
- SSH access configured (recommended) or HTTPS with credentials
Step 1: Create the Repository
GitHub
- Go to github.com/new
- Name it something like
aligntrue-personal-rules - Set visibility to Private
- Do not initialize with README (AlignTrue will do this)
- Click “Create repository”
GitLab
- Go to your GitLab instance
- Click “New project” → “Create blank project”
- Name it
aligntrue-personal-rules - Set visibility to Private
- Uncheck “Initialize repository with a README”
- Click “Create project”
Self-hosted Git
- Create a new repository on your git server
- Ensure you have read/write access
- Note the SSH or HTTPS URL
Step 2: Configure SSH Access (Recommended)
SSH is the recommended method because it doesn’t require entering credentials repeatedly.
Check Existing SSH Keys
ls -la ~/.sshLook for files like id_rsa.pub, id_ed25519.pub, or id_ecdsa.pub.
Generate New SSH Key (if needed)
ssh-keygen -t ed25519 -C "your_email@example.com"Press Enter to accept the default location. Optionally set a passphrase.
Add SSH Key to Your Git Host
GitHub:
- Copy your public key:
cat ~/.ssh/id_ed25519.pub - Go to github.com/settings/keys
- Click “New SSH key”
- Paste the key and save
GitLab:
- Copy your public key (same as above)
- Go to your GitLab profile → SSH Keys
- Paste the key and save
Test SSH Connection
# GitHub
ssh -T git@github.com
# GitLab
ssh -T git@gitlab.comYou should see a success message.
Step 3: Configure AlignTrue
During Team Migration
When you run aligntrue team enable, the wizard will prompt you:
What should we do with personal rules?
○ Promote to team (visible to all)
○ Move to remote (private, version controlled)
○ Keep local only (private, not version controlled)Select “Move to remote” and follow the prompts.
Manual Configuration
Edit .aligntrue/config.yaml:
mode: team
storage:
team:
type: repo
personal:
type: remote
url: git@github.com:yourusername/aligntrue-personal-rules.git
branch: main
path: rules # Optional subdirectoryOr using the new resources format:
mode: team
resources:
rules:
scopes:
team:
sections: "*"
personal:
sections: "*"
storage:
team:
type: repo
personal:
type: remote
url: git@github.com:yourusername/aligntrue-personal-rules.git
branch: mainStep 4: Initial Sync
Run the sync command:
aligntrue syncAlignTrue will:
- Clone your personal repository to
.aligntrue/.remotes/personal/ - Write your personal rules to
rules.mdin that repository - Commit and push the changes
Step 5: Verify
Check that your personal rules were pushed:
# View the remote repository
cd .aligntrue/.remotes/personal
git log
# Or check on your git host's web interfaceTroubleshooting
SSH Connection Fails
Error: Permission denied (publickey)
Fix:
- Verify SSH key is added to your git host
- Test connection:
ssh -T git@github.com - Check SSH agent is running:
ssh-add -l - Add key to agent:
ssh-add ~/.ssh/id_ed25519
Clone Fails
Error: Repository not found
Fix:
- Verify the URL is correct
- Ensure the repository exists
- Check you have access to the repository
- For private repos, ensure SSH key or credentials are configured
Push Fails
Error: failed to push some refs
Fix:
- Pull latest changes first:
cd .aligntrue/.remotes/personal && git pull - Resolve any conflicts manually
- Run
aligntrue syncagain
Wrong Branch
Error: Remote branch 'main' not found
Fix:
Some repositories use master instead of main. Update your config:
storage:
personal:
type: remote
url: git@github.com:yourusername/aligntrue-personal-rules.git
branch: master # Changed from mainUsing HTTPS Instead of SSH
If you prefer HTTPS over SSH:
storage:
personal:
type: remote
url: https://github.com/yourusername/aligntrue-personal-rules.git
branch: mainNote: You’ll need to configure git credentials:
# Use credential helper
git config --global credential.helper store
# Or use SSH (recommended)Syncing Across Multiple Machines
Once your personal rules are in a remote repository, you can sync them across machines:
- On machine A:
aligntrue sync(pushes changes) - On machine B:
aligntrue sync(pulls changes)
AlignTrue automatically handles pull/push during sync.
Backup Considerations
Your personal rules are now backed up in two places:
- Remote repository - Version controlled, accessible from anywhere
- Local backups -
.aligntrue/.backups/personal/
To restore from backup:
aligntrue revertSelect a backup with scope: personal to restore only personal rules.
Security Notes
- Always use private repositories for personal rules
- Use SSH keys instead of passwords
- Rotate SSH keys periodically
- Review repository access permissions regularly
- Consider using a dedicated SSH key for AlignTrue