The cf update command automatically updates the cf tool to the latest version from the git repository and runs the setup script.
cf update- Verifies the directory is a git repository
- Detects uncommitted changes and prompts for confirmation
- Allows user to cancel update if needed
- Fetches latest changes from the tracked remote (
originby default) - Fast-forwards the current branch (
git pull --ff-only); a diverged branch is reported instead of being merged - Runs the setup script automatically (skip with
CF_UPDATE_SKIP_SETUP=1) - Returns to the original directory
Run cf version afterwards to confirm the new version.
- Exits with error if not in a git repository
- Fails gracefully if fetch/pull fails
- Warns if setup script is missing or encounters issues
- Preserves user's working directory
$ cf update
Info: Updating cf tool to latest version...
Info: Fetching latest changes from remote...
Info: Pulling latest changes...
Success: Repository updated successfully
Info: Running setup script...
Success: Setup completed successfully
Success: cf tool updated to latest version!
Run 'cf help' to see all available commands$ cf update
Info: Updating cf tool to latest version...
Warning: You have uncommitted changes in the repository
Continue with update? (y/N): n
Info: Update cancelledThe update command is integrated into:
- Main command dispatcher
- Help documentation
- Usage messages
- Requires git repository: Won't run outside of git context
- User confirmation: Prompts before updating with uncommitted changes
- Sudo permissions: Setup script may require sudo for system-wide installation
- Source verification: Only pulls from configured git remote
- Commit or stash changes before updating
- Review changelog after major updates
- Test in development environment first
- Keep backup of customizations
Error: Failed to fetch from remote repositorySolution: Check internet connection and git remote configuration
Warning: Setup script encountered issues, but update completedSolution: Repository updated but setup had problems. Run ./scripts/setup.sh manually
Error: Not a git repository: /path/to/cfSolution: Ensure cf tool was installed via git clone