Skip to main content
wit provides full support for remote Git operations, allowing you to collaborate with others using any Git hosting service including GitHub, GitLab, Bitbucket, or self-hosted servers.

Quick Reference

Clone

Clone a repository from a remote URL:

Clone Options

Remotes

Manage remote repository connections:

Fetch

Download objects and refs from a remote without merging:

Fetch Options

After fetching, you can see what changed:

Pull

Fetch from remote and merge into current branch:

Pull Options

Pull Strategies

Best for: Preserving complete history of parallel development

Pull Conflicts

If there are conflicts during pull:

Push

Upload local commits to a remote repository:

Push Options

Force Push Warning: Using --force can overwrite remote history and cause problems for collaborators. Prefer --force-with-lease which checks that the remote hasn’t changed before pushing.

Dual-Push (Multiple Remotes)

Push to multiple remotes simultaneously. This is useful when you want to keep both a wit server and GitHub (or another Git host) in sync:
Use Case: If you’re using wit as your primary version control but need to sync with GitHub for CI/CD or deployment providers (Vercel, Netlify, etc.), dual-push keeps both remotes in sync with a single command.
Example workflow:

Push Rejections

If your push is rejected, it usually means the remote has changes you don’t have:

Authentication

GitHub Authentication

The recommended way to authenticate with GitHub:

Environment Variables

You can also use environment variables:

Personal Access Tokens

For other Git hosts, use personal access tokens:

Working with Forks

Common fork workflow:

Tracking Branches

Set up tracking between local and remote branches:

Complete Workflow Example

Troubleshooting

”Authentication failed"

"Updates were rejected”

Your local branch is behind the remote:

“No upstream branch”

Tips

Run wit fetch regularly to stay up-to-date with remote changes without affecting your working directory.
Set up tracking with wit push -u so future pushes/pulls just work with wit push and wit pull.
When you need to force push, use --force-with-lease to prevent accidentally overwriting someone else’s work.
Use wit fetch --prune to remove tracking branches for remote branches that have been deleted.