Remote Access Troubleshooting
This guide helps you resolve common issues when using remote repositories for personal rules in AlignTrue.
SSH Issues
Permission Denied (publickey)
Error:
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.Cause: SSH key not configured or not added to your git host.
Solution:
-
Check if you have an SSH key:
ls -la ~/.ssh -
If no key exists, generate one:
ssh-keygen -t ed25519 -C "your_email@example.com" -
Add the key to your SSH agent:
eval "$(ssh-agent -s)" ssh-add ~/.ssh/id_ed25519 -
Copy your public key:
cat ~/.ssh/id_ed25519.pub -
Add it to your git host:
- GitHub: github.com/settings/keys
- GitLab: Profile → SSH Keys
- Bitbucket: Personal settings → SSH keys
-
Test the connection:
ssh -T git@github.com
SSH Key Passphrase Prompts
Problem: SSH keeps asking for passphrase on every operation.
Solution:
Add your key to the SSH agent permanently:
macOS:
ssh-add --apple-use-keychain ~/.ssh/id_ed25519Add to ~/.ssh/config:
Host *
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/id_ed25519Linux:
ssh-add ~/.ssh/id_ed25519Add to ~/.bashrc or ~/.zshrc:
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519 2>/dev/nullWindows:
# Start SSH agent service
Get-Service ssh-agent | Set-Service -StartupType Automatic
Start-Service ssh-agent
# Add key
ssh-add $HOME\.ssh\id_ed25519Wrong Host Key
Error:
WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!Cause: Server’s SSH key changed (or potential security issue).
Solution:
-
Verify the change is legitimate (check with your git host)
-
Remove the old key:
ssh-keygen -R github.com -
Reconnect and accept the new key:
ssh -T git@github.com
Clone Issues
Repository Not Found
Error:
fatal: repository 'https://github.com/user/repo.git' not foundCauses:
- Repository doesn’t exist
- Wrong URL
- No access to private repository
- Using HTTPS without credentials
Solutions:
-
Verify the repository exists on your git host
-
Check the URL in your config:
aligntrue config get storage.personal.url -
For private repos, use SSH instead of HTTPS:
# Change from: url: https://github.com/user/repo.git # To: url: git@github.com:user/repo.git -
Verify you have access:
git ls-remote git@github.com:user/repo.git
Already Exists
Error:
fatal: destination path '.aligntrue/.remotes/personal' already existsCause: Previous clone attempt failed or directory exists.
Solution:
-
Remove the directory:
rm -rf .aligntrue/.remotes/personal -
Sync again:
aligntrue sync
Push/Pull Issues
Push Rejected
Error:
! [rejected] main -> main (fetch first)
error: failed to push some refsCause: Remote has changes you don’t have locally.
Solution:
-
Navigate to the remote directory:
cd .aligntrue/.remotes/personal -
Pull changes:
git pull origin main -
If there are conflicts, resolve them:
git status # Edit conflicting files git add . git commit -m "Resolve conflicts" -
Return to project root and sync:
cd ../../../ aligntrue sync
Merge Conflicts
Error:
CONFLICT (content): Merge conflict in rules.md
Automatic merge failedSolution:
-
Navigate to the remote:
cd .aligntrue/.remotes/personal -
Check status:
git status -
Edit conflicting files:
# Open rules.md and resolve conflicts # Remove conflict markers: <<<<<<<, =======, >>>>>>> -
Complete the merge:
git add rules.md git commit -m "Resolve merge conflict" git push origin main -
Return and sync:
cd ../../../ aligntrue sync
Diverged Branches
Error:
Your branch and 'origin/main' have divergedCause: Local and remote have different commits.
Solution:
-
Pull with rebase:
cd .aligntrue/.remotes/personal git pull --rebase origin main -
If conflicts, resolve them and continue:
git rebase --continue -
Push:
git push origin main
HTTPS Issues
Authentication Failed
Error:
fatal: Authentication failed for 'https://github.com/user/repo.git'Solutions:
Option 1: Use SSH (Recommended)
# In .aligntrue/config.yaml
storage:
personal:
type: remote
url: git@github.com:user/repo.git # Changed to SSHOption 2: Use Personal Access Token
-
Create a token:
- GitHub: Settings → Developer settings → Personal access tokens
- GitLab: Profile → Access Tokens
- Bitbucket: Personal settings → App passwords
-
Configure git credential helper:
git config --global credential.helper store -
On next push, enter:
- Username: your username
- Password: your token (not your actual password)
Option 3: Use SSH Credential Helper
git config --global credential.helper 'cache --timeout=3600'Token Expired
Error:
remote: Invalid username or password.Cause: Personal access token expired.
Solution:
-
Generate a new token on your git host
-
Update stored credentials:
# Remove old credentials git credential reject <<EOF protocol=https host=github.com EOF # Next push will prompt for new token
Network Issues
Connection Timeout
Error:
fatal: unable to access 'https://github.com/user/repo.git/':
Failed to connect to github.com port 443: Connection timed outSolutions:
-
Check your internet connection
-
Check if git host is accessible:
ping github.com -
Try SSH instead of HTTPS:
url: git@github.com:user/repo.git -
Check firewall/proxy settings
-
If behind corporate proxy, configure git:
git config --global http.proxy http://proxy.company.com:8080
SSL Certificate Problem
Error:
SSL certificate problem: unable to get local issuer certificateSolutions:
Option 1: Update CA certificates (Recommended)
# macOS
brew install ca-certificates
# Ubuntu/Debian
sudo apt-get update && sudo apt-get install ca-certificates
# Windows
# Download and install latest Git for WindowsOption 2: Disable SSL verification (Not Recommended)
git config --global http.sslVerify falseOption 3: Use SSH
SSH doesn’t use SSL certificates, so this avoids the issue entirely.
Branch Issues
Branch Not Found
Error:
fatal: couldn't find remote ref mainCause: Repository uses master instead of main (or vice versa).
Solution:
-
Check the default branch on your git host
-
Update your config:
storage: personal: type: remote url: git@github.com:user/repo.git branch: master # Changed from main -
Sync again:
aligntrue sync
Detached HEAD
Problem: Remote repository is in detached HEAD state.
Solution:
cd .aligntrue/.remotes/personal
git checkout main
cd ../../../
aligntrue syncPermission Issues
Permission Denied (Repository)
Error:
remote: Permission to user/repo.git deniedCause: No write access to the repository.
Solutions:
-
Verify you own the repository or have write access
-
Check repository settings on your git host
-
If using organization repo, ensure you’re a member
-
Create a new repository under your account:
# On GitHub gh repo create aligntrue-personal-rules --private # Update config with new URL
File Permission Errors
Error:
error: unable to create file rules.md: Permission deniedCause: File system permissions issue.
Solution:
# Check ownership
ls -la .aligntrue/.remotes/personal
# Fix ownership (replace USER with your username)
sudo chown -R USER:USER .aligntrue/.remotes/personal
# Or remove and re-clone
rm -rf .aligntrue/.remotes/personal
aligntrue syncConfiguration Issues
Invalid URL Format
Error:
fatal: invalid URL 'user/repo.git'Cause: URL is not complete.
Solution:
Use full URL format:
# SSH (Recommended)
url: git@github.com:user/repo.git
# HTTPS
url: https://github.com/user/repo.gitMissing URL
Error:
Error: Remote storage 'personal' requires a 'url'Solution:
Add URL to your config:
storage:
personal:
type: remote
url: git@github.com:yourusername/aligntrue-personal-rules.git
branch: mainGetting More Help
If you’re still stuck:
-
Check AlignTrue logs:
aligntrue sync --verbose -
Validate configuration:
aligntrue check -
Test git access directly:
cd .aligntrue/.remotes/personal git remote -v git fetch origin -
Check git configuration:
git config --list -
Review git host status:
- GitHub: githubstatus.com
- GitLab: status.gitlab.com