Alpha — CodeAnvil is under active development and not yet publicly announced.

Repository Management

Learn how to create repositories, manage access control, and configure visibility settings in CodeAnvil.

Beginner

Create a Repository

There are two ways to create a repository in CodeAnvil:

From an Existing Project (Recommended)

The easiest way is to use repo setup from your project directory:

bash
# Navigate to your project
cd my-project

# Setup repository on CodeAnvil
anvil repo setup

# This will:
# 1. Create the repository on the server
# 2. Add the origin remote to your local git config
# 3. Ready to push!

Manual Setup

If you need more control, you can create the repository manually:

bash
# Create repository on server
anvil repo create my-repo

# Add remote to local git
git remote add origin ssh://git@codeanvil.io:2222/~/my-repo.git

# Push
git push -u origin main

List Your Repositories

bash
# List all repositories you have access to
anvil repo list

Access Control

Control who can read, write, and administer your repositories.

Add Members

bash
# Add a member with write access
anvil repo member-add my-repo alice@example.com write

# Add an admin
anvil repo member-add my-repo bob@example.com admin

# Add a read-only member
anvil repo member-add my-repo charlie@example.com read

List Members

bash
# List all repository members
anvil repo member-list my-repo

# Example output:
# alice@example.com   write
# bob@example.com     admin
# charlie@example.com read

Remove Members

bash
# Remove a member's access
anvil repo member-remove my-repo charlie@example.com

Member Roles

CodeAnvil supports three roles for repository members:

Role Read Write Approve PRs Manage Members Change Settings
read
write
admin
💡 Who Can Approve PRs?

Only members with write or admin roles can approve pull requests. Read-only members can view PRs but cannot approve them.

Repository Visibility

Control whether your repository is private or public.

Set Visibility

bash
# Make repository public (admin only)
anvil repo set-visibility my-repo public

# Make repository private (admin only)
anvil repo set-visibility my-repo private

# Check current visibility
anvil repo get-visibility my-repo
Setting Read Access Write Access
private (default) Members only Members with write/admin role
public Anyone (including anonymous) Members with write/admin role

Public Repositories

Public repositories allow anyone to clone and read your code without authentication.

Anonymous Clone

Anyone can clone a public repository using the git SSH username:

bash
# Clone a public repo anonymously (no authentication required)
git clone ssh://git@codeanvil.io:2222/~/my-public-repo.git
⚠️ Write Access Still Restricted

Even for public repositories, pushing changes requires authentication and membership with write or admin role. Anonymous users can only read.

Security Considerations

  • Default is Private: New repositories are private by default
  • Admin Only: Only repository admins can change visibility
  • Code is Public: Once public, anyone can see your code — be careful with secrets

Git Remote Configuration

CodeAnvil uses SSH URLs for git remotes:

bash
# Standard remote URL format
ssh://git@codeanvil.io:2222/~/repo-name.git

# View current remotes
git remote -v

# Update origin URL
git remote set-url origin ssh://git@codeanvil.io:2222/~/my-repo.git

Custom SSH Key

If you need to use a specific SSH key for CodeAnvil:

bash
# Method 1: Environment variable
export ANVIL_SSH_COMMAND="ssh -i ~/.ssh/anvil_key"
anvil repo list

# Method 2: SSH config (~/.ssh/config)
Host codeanvil.io
    HostName codeanvil.io
    Port 2222
    User git
    IdentityFile ~/.ssh/anvil_key