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
- Merge (default)
- Rebase
- Fast-forward only
Pull Conflicts
If there are conflicts during pull:Push
Upload local commits to a remote repository:Push Options
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: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
Keep fetched data fresh
Keep fetched data fresh
Run
wit fetch regularly to stay up-to-date with remote changes without affecting your working directory.Use upstream tracking
Use upstream tracking
Set up tracking with
wit push -u so future pushes/pulls just work with wit push and wit pull.Prefer --force-with-lease
Prefer --force-with-lease
When you need to force push, use
--force-with-lease to prevent accidentally overwriting someone else’s work.Clean up stale branches
Clean up stale branches
Use
wit fetch --prune to remove tracking branches for remote branches that have been deleted.