4.2 KiB
Creating, Forking, Transferring, or Cloning a Repo
This page covers all operations for creating, forking, transferring ownership, and cloning repositories in GitRepublic.
Creating a Repository
Via Web Interface
- Navigate to the Sign Up page (
/signup) - Connect your NIP-07 browser extension
- Fill in repository details:
- Repository Name: Choose a unique name
- Description: Describe your repository
- Visibility: Select visibility level (public, unlisted, restricted, private)
- Project Relays: Add project relays (required for unlisted/restricted)
- Clone URLs: Add existing clone URLs if migrating
- Maintainers: Add maintainer npubs (optional)
- Click Publish Repository Announcement
The server will automatically:
- Create a Nostr event announcing your repository
- Provision a bare git repository
- Create a self-transfer event for ownership proof
- Publish events to relays (based on visibility)
- Save events to the repository
Via CLI
gitrep publish repo-announcement <repo-name> \
--description "My repository" \
--clone-url "https://domain.com/api/git/npub1.../repo.git" \
--visibility public
See gitrep --help for complete CLI documentation.
Repository URL Structure
Your repository will be accessible at:
- Web:
https://{domain}/repos/{your-npub}/{repository-name} - Git:
https://{domain}/api/git/{your-npub}/{repository-name}.git(recommended)
Forking a Repository
Forking creates your own copy of a repository that you can modify independently.
Via Web Interface
- Navigate to the repository you want to fork
- Click the Fork button
- Enter a name for your fork
- Click Fork
GitRepublic will:
- Clone the repository to your account
- Create a new repository announcement for your fork
- Set you as the owner
- Preserve visibility and project-relay settings from original
- Add a reference to the original repository
Via CLI
gitrep repos fork <owner-npub> <repo-name>
Working with Forks
After forking:
- Clone your fork:
git clone https://{domain}/api/git/{your-npub}/{fork-name}.git - Make changes and push to your fork
- Create a pull request back to the original repository
Transferring Ownership
Transfer repository ownership to another user.
Via Web Interface
- Navigate to your repository
- Click Transfer Ownership (in repository menu)
- Enter the new owner's npub
- Confirm the transfer
The transfer process:
- Creates an ownership transfer event (kind 1641)
- Publishes to Nostr relays
- Saves to repository for verification
- Notifies new owner when they log in
- New owner completes transfer by publishing new announcement
Via CLI
gitrep repos transfer <npub> <repo> <new-owner-npub>
Important: Ownership transfers are permanent and create a chain of ownership events. The new owner will have full control.
Cloning a Repository
Public Repositories
Anyone can clone public repositories:
git clone https://{domain}/api/git/{owner-npub}/{repo-name}.git
Private/Restricted Repositories
Private and restricted repositories require authentication:
-
Install GitRepublic CLI:
npm install -g gitrepublic-cli -
Set your Nostr private key:
export NOSTRGIT_SECRET_KEY="nsec1..." -
Run setup:
gitrep-setup -
Clone the repository:
git clone https://{domain}/api/git/{owner-npub}/{repo-name}.git
The credential helper will automatically generate NIP-98 authentication tokens.
Clone URL Paths
GitRepublic supports multiple clone URL paths:
/api/git/{npub}/{repo}.git- Recommended (best compatibility)/repos/{npub}/{repo}.git- Alternative path/{npub}/{repo}.git- Root path
All paths work, but /api/git/ is recommended for best compatibility with commit signing hooks.
Multi-Remote Synchronization
If a repository has multiple clone URLs configured, GitRepublic automatically syncs changes to all remotes when you push. You can see all clone URLs on the repository page.
Next Steps
- Editing a repo - Learn about branch management and file operations
- Managing a repo - Complete repository management guide