glab repo
Work with GitLab repositories and projects.
Quick start
# Clone a repository
glab repo clone group/project
# Create new repository
glab repo create my-new-project --public
# Fork a repository
glab repo fork upstream/project
# View repository details
glab repo view
# Search for repositories
glab repo search "keyword"
Common workflows
Starting new project
Create repository:
glab repo create my-project \ --public \ --description "My awesome project"Clone locally:
glab repo clone my-username/my-project cd my-projectInitialize with content:
echo "# My Project" > README.md git add README.md git commit -m "Initial commit" git push -u origin main
Forking workflow
Fork upstream repository:
glab repo fork upstream-group/projectClone your fork:
glab repo clone my-username/project cd projectAdd upstream remote:
git remote add upstream https://gitlab.com/upstream-group/project.gitKeep fork in sync:
git fetch upstream git merge upstream/main
Automated sync:
Use the sync script for one-command fork updates:
scripts/sync-fork.sh main
scripts/sync-fork.sh develop upstream
This automatically: fetches → merges → pushes to origin.
Repository management
View repository info:
glab repo view
glab repo view group/project # Specific repo
glab repo view --web # Open in browser
Update repository settings:
glab repo update \
--description "Updated description" \
--default-branch develop
Archive repository:
glab repo archive download main # Downloads .tar.gz
glab repo archive download main --format zip
Transfer to new namespace:
glab repo transfer my-project --target-namespace new-group
Delete repository:
glab repo delete group/project
Member management
List collaborators:
glab repo members list
Add member:
glab repo members add @username --access-level maintainer
Remove member:
glab repo members remove @username
Update member access:
glab repo members update @username --access-level developer
Bulk operations
Clone all repos in a group:
glab repo clone -g my-group
Search and clone:
glab repo search "api" --per-page 10
# Then clone specific result
glab repo clone group/api-project
List your repositories:
glab repo list
glab repo list --member # Only where you're a member
glab repo list --mine # Only repos you own
Troubleshooting
Clone fails with permission error:
- Verify you have access:
glab repo view group/project - Check authentication:
glab auth status - For private repos, ensure you're logged in with correct account
Fork operation fails:
- Check if fork already exists in your namespace
- Verify you have permission to fork (some repos disable forking)
- Try with explicit namespace:
glab repo fork --fork-path username/new-name
Transfer fails:
- Verify you have owner/maintainer access
- Check target namespace exists and you have create permissions
- Some projects may have transfer protections enabled
Group clone fails:
- Verify group exists and you have access
- Check you have enough disk space
- Large groups may time out - clone specific repos instead
Related Skills
Authentication and access:
- See
glab-authfor login and authentication setup - See
glab-ssh-keyfor SSH key management - See
glab-deploy-keyfor deployment authentication
Project configuration:
- See
glab-configfor CLI defaults and settings - See
glab-variablefor CI/CD variables
Fork synchronization:
- Script:
scripts/sync-fork.shautomates upstream sync
v1.89.0 Updates
v1.89.0+:
glab repo contributorssupports--output json/-F jsonfor structured output, ideal for agent automation.
# List contributors with JSON output (v1.89.0+)
glab repo contributors --output json
glab repo contributors -F json
Command reference
For complete command documentation and all flags, see references/commands.md.
Available commands:
clone- Clone repository or groupcreate- Create new projectfork- Fork repositoryview- View project detailsupdate- Update project settingsdelete- Delete projectsearch- Search for projectslist- List repositoriestransfer- Transfer to new namespacearchive- Download repository archivecontributors- List contributorsmembers- Manage project membersmirror- Configure repository mirroringpublish- Publish project resources
Converted and distributed by TomeVault — claim your Tome and manage your conversions.