Skip to main content

Prerequisites

Before setting up Git sync, ensure you have:
1

Git Installed

Verify Git is installed on your system:
git --version
If not installed, download from git-scm.com
2

Git Repository

Create a repository on your preferred Git service:
  • GitHub
  • GitLab
  • Gitee
  • Self-hosted Git server
3

Authentication

Set up SSH keys or access tokens for authentication

Quick Setup

For New Workspaces

1

Create Workspace

Create a new workspace in Auk
2

Enable Git Sync

In workspace settings, enable “Git Synchronization”
3

Enter Repository URL

[email protected]:username/api-collections.git
4

Initial Push

Auk will push your current workspace data to the repository

For Existing Workspaces

1

Open Workspace Settings

Navigate to Settings → Git Sync
2

Initialize Git

Click “Initialize Git Repository”
3

Add Remote

Enter your remote repository URL
4

Push Existing Data

Auk commits and pushes your existing collections

Repository Setup

GitHub

  1. Go to github.com/new
  2. Enter repository name: api-collections
  3. Choose Private (recommended for API data)
  4. Do NOT initialize with README
  5. Click “Create repository”

GitLab

  1. Go to GitLab → New Project
  2. Choose “Create blank project”
  3. Enter project name: api-collections
  4. Set visibility to Private
  5. Uncheck “Initialize repository with a README”
  6. Click “Create project”

Gitee (码云)

  1. 访问 gitee.com
  2. 点击 ”+” → “新建仓库”
  3. 输入仓库名称:api-collections
  4. 选择 私有
  5. 不要初始化 README
  6. 点击 “创建”

Authentication Methods

Most secure and convenient method:
1

Generate SSH Key

ssh-keygen -t ed25519 -C "[email protected]"
Press Enter to accept default location
2

Start SSH Agent

eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
3

Copy Public Key

# macOS
pbcopy < ~/.ssh/id_ed25519.pub

# Linux
xclip -sel clip < ~/.ssh/id_ed25519.pub

# Windows (Git Bash)
cat ~/.ssh/id_ed25519.pub | clip
4

Add to Git Service

Add the public key to your Git service (GitHub/GitLab/etc.)
5

Test Connection

# GitHub
ssh -T [email protected]

# GitLab
ssh -T [email protected]

# Gitee
ssh -T [email protected]

HTTPS with Personal Access Token

Alternative method using HTTPS:
1

Generate Token

Create a personal access token in your Git service settings
2

Required Permissions

  • GitHub: repo scope
  • GitLab: read_repository, write_repository
  • Gitee: projects scope
3

Use in Auk

Enter repository URL with token:
https://[email protected]/username/api-collections.git
Store tokens securely. Never commit tokens to Git or share them publicly.

Initial Configuration

Configure Git User

Set your Git identity:
git config --global user.name "Your Name"
git config --global user.email "[email protected]"

Configure Auk Git Settings

In Auk workspace settings:
{
  "git": {
    "enabled": true,
    "remoteUrl": "[email protected]:username/api-collections.git",
    "branch": "main",
    "autoSync": true,
    "syncInterval": 900,
    "autoCommit": true,
    "conflictResolution": "prompt"
  }
}

Sync Strategies

Automatic Sync

Enable automatic synchronization:
autoSync
boolean
default:"false"
Automatically sync at regular intervals
syncInterval
number
default:"900"
Sync interval in secondsRecommended values:
  • 300 (5 min) - Active team collaboration
  • 900 (15 min) - Balanced (default)
  • 3600 (1 hour) - Less frequent updates

Manual Sync

Trigger sync manually when needed:
  • Click sync button in workspace toolbar
  • Use keyboard shortcut: Cmd/Ctrl + Shift + S
  • Before switching workspaces
  • After completing a feature

Branch Strategy

Single Branch (Simple)

Use one branch for all work:
main

All team members work here
Best for:
  • Small teams
  • Simple workflows
  • Quick collaboration

Feature Branches

Create branches for features:
main
  ├── feature/auth-endpoints
  ├── feature/payment-api
  └── feature/user-management
Best for:
  • Larger teams
  • Complex changes
  • Code review workflows

Environment Branches

Separate branches per environment:
production

staging

development
Best for:
  • Multiple environments
  • Staged deployments
  • Testing workflows

First Sync

Push Existing Data

If you have existing collections:
1

Auk Creates Initial Commit

Initial commit: Add existing collections

- 5 collections
- 3 environments
- Workspace settings
2

Push to Remote

Auk pushes the commit to your remote repository
3

Verify

Check your Git service to confirm data is uploaded

Clone Existing Repository

If joining an existing team:
1

Create Workspace

Choose “Clone from Git” when creating workspace
2

Enter Repository URL

[email protected]:team/api-collections.git
3

Clone and Open

Auk clones the repository and opens the workspace

Verification

Check Git Status

Verify Git is working correctly:
# Navigate to workspace directory
cd ~/Library/Application\ Support/Auk/workspaces/my-workspace

# Check Git status
git status

# View commit history
git log --oneline

# Check remote
git remote -v

Test Sync

Make a small change and verify sync:
  1. Create a new collection or request
  2. Wait for auto-sync or trigger manual sync
  3. Check Git service for new commit
  4. Verify changes appear for team members

Troubleshooting

Symptoms: Cannot push/pull, authentication errorsSolutions:
  • Verify SSH key is added to Git service
  • Test SSH connection: ssh -T [email protected]
  • Check token has correct permissions
  • Regenerate SSH key or token if needed
Symptoms: “Permission denied (publickey)” errorSolutions:
# Check SSH agent is running
eval "$(ssh-agent -s)"

# Add SSH key
ssh-add ~/.ssh/id_ed25519

# Verify key is loaded
ssh-add -l
Symptoms: “Repository not found” or 404 errorSolutions:
  • Verify repository URL is correct
  • Check you have access to the repository
  • Ensure repository exists on Git service
  • Try cloning manually to test access
Symptoms: Sync stops with merge conflictSolutions:

Next Steps

Auto Sync

Configure automatic synchronization

Conflict Resolution

Learn how to handle merge conflicts

Authentication

Advanced authentication options

Troubleshooting

Common issues and solutions