Git Remotes¶
Collaborate continuously with team members by pushing and pulling environment changes through git remotes.
Overview¶
Git remotes enable real-time collaboration by syncing environment versions through a shared git repository. Each environment has its own git repository in the .cec/ directory that tracks:
- Environment configuration (
pyproject.toml) - Python dependencies (
uv.lock) - Workflows (
.cec/workflows/*.json) - Version history (git commits)
This is ideal for:
- Team development: Multiple people working on the same environment
- Version tracking: Full git history of environment changes
- Branch workflows: Develop features in branches, merge to main
- Continuous sync: Push/pull updates as you work
Unlike export/import (which creates one-time snapshots), git remotes enable ongoing collaboration with full version control.
Managing Remotes¶
Each environment can have multiple git remotes for pushing and pulling changes.
Adding a Remote¶
Add a remote repository to your environment:
Output:
Common remote names:
origin: Primary remote (convention from git)upstream: Upstream repository for forksbackup: Backup location
Environment-Specific
Remotes are configured per-environment. Each environment has its own git repository and remote configuration.
Listing Remotes¶
View all configured remotes:
Output:
Remotes:
origin https://github.com/user/comfy-env.git (fetch)
origin https://github.com/user/comfy-env.git (push)
backup git@gitlab.com:user/comfy-backup.git (fetch)
backup git@gitlab.com:user/comfy-backup.git (push)
Each remote shows separate fetch and push URLs (usually the same).
Removing a Remote¶
Remove a remote that's no longer needed:
Output:
Pushing Changes¶
Push commits to a remote repository to share your environment updates.
Basic Push¶
Push to the default remote (origin):
Output:
Changes are now visible to anyone with access to the remote repository.
Push to Specific Remote¶
Push to a named remote:
Push with Force¶
Force push when you need to overwrite remote history (use carefully):
Force Push Safety
Force push uses --force-with-lease to prevent overwriting others' changes. It only succeeds if the remote branch hasn't been updated since your last fetch.
Push Requirements¶
ComfyDock ensures safe pushes by validating your environment state.
Clean Working Directory¶
Push requires all changes to be committed:
If uncommitted changes exist:
Fix:
This includes both git changes (in .cec/) and workflow changes (in ComfyUI/).
Remote Configuration¶
Push fails if no remote is configured:
Fix:
Authentication¶
Push may fail with authentication errors:
Solutions:
-
Use SSH: Configure git to use SSH keys
-
Use credential helper: Configure git credential storage
-
Personal access token: Use GitHub/GitLab personal access tokens instead of passwords
Pulling Changes¶
Pull fetches changes from a remote and merges them into your environment.
Basic Pull¶
Pull from the default remote (origin):
Output:
📥 Pulling from origin/main
⬇️ Fetching changes from remote
✓ Merged 3 commits
🔄 Reconciling environment with pulled changes
📦 Installing nodes
[1/2] Installing rgthree-comfy... ✓
[2/2] Installing was-node-suite-comfyui... ✓
🔧 Syncing Python packages
✓ Python environment synced
📝 Restoring workflows
✓ Workflows synced to ComfyUI
⏭ Auto-committing post-pull state
✓ Pull complete: environment synced to latest
The pull process:
- Fetches changes from remote
- Merges into local branch
- Reconciles nodes (install/remove based on changes)
- Syncs Python packages to match
uv.lock - Restores workflows from
.cectoComfyUI/ - Commits the merged state as a new version
Pull from Specific Remote¶
Pull from a named remote:
Pull Reconciliation¶
Pull doesn't just update git files—it reconciles your entire environment to match the pulled configuration.
What Gets Reconciled¶
After merging git changes, ComfyDock updates:
Custom Nodes:
- Added nodes: Installed automatically from registry/git
- Removed nodes: Uninstalled and cleaned up
- Version changes: Updated to match new commit
Python Packages:
- Dependencies synced: Matches
uv.lockfrom remote - Groups installed: All dependency groups reconciled
Workflows:
- New workflows: Copied from
.cec/workflows/toComfyUI/ - Updated workflows: Overwritten with tracked versions
- Deleted workflows: Removed from
ComfyUI/
Working Directory Overwrite
Pull overwrites ComfyUI/ workflows with tracked versions from .cec/. Uncommitted workflow changes are lost unless you commit first.
Example: Node Reconciliation¶
Scenario: Remote added was-node-suite-comfyui and removed comfyui-manager.
Pull output:
🔄 Reconciling environment with pulled changes
📦 Installing nodes
[1/1] Installing was-node-suite-comfyui... ✓
🗑️ Removing nodes
[1/1] Removing comfyui-manager... ✓
Your local environment now matches the remote configuration.
Model Download Strategy¶
Control whether pull downloads new model dependencies.
Strategy: All (Default)¶
Downloads all models referenced in pulled workflows:
Automatically resolves and downloads any new model dependencies.
Strategy: Required¶
Downloads only required models:
Skips optional and flexible models.
Strategy: Skip¶
Skips all model downloads:
Models are tracked as download intents. Resolve later:
Pull Requirements¶
Pull requires a clean working directory to prevent conflicts.
Clean State Required¶
Pull fails if you have uncommitted changes:
If changes exist:
✗ Cannot pull with uncommitted changes.
Uncommitted changes detected:
• Git changes in .cec/
• Workflow changes in ComfyUI
Commit first:
comfydock commit -m 'message'
Fix:
Force Pull¶
Discard local changes and force pull:
Data Loss Warning
Force pull discards ALL uncommitted changes (git and workflows). Use with caution.
Merge Conflicts¶
Git merge conflicts require manual resolution.
Detecting Conflicts¶
Pull fails when conflicts occur:
Resolving Conflicts¶
-
View conflicts:
-
Edit conflicted files to resolve conflicts:
Look for conflict markers:
<<<<<<< HEAD
[tool.comfydock.nodes]
"my-node" = { source = "registry" }
=======
[tool.comfydock.nodes]
"other-node" = { source = "registry" }
>>>>>>> origin/main
-
Stage resolved files:
-
Commit the merge:
-
Sync environment:
Avoiding Conflicts
- Pull frequently to stay up-to-date
- Communicate with team about major changes
- Use branches for experimental work
Rollback on Failure¶
If pull fails after merging, ComfyDock automatically rolls back git changes.
Automatic Rollback¶
Scenario: Pull succeeds in merging, but node installation fails.
Output:
✗ Pull failed: Could not install rgthree-comfy - network error
Rolling back git changes...
✓ Rollback complete: environment restored to pre-pull state
Your environment is restored to exactly how it was before the pull attempt.
What Gets Rolled Back¶
- Git files:
pyproject.toml,uv.lock, workflows restored - Environment state: Nodes, packages unchanged
This ensures pull is atomic—it either succeeds completely or reverts entirely.
Version History¶
Each push and pull creates versions in your environment history.
View Version History¶
See past versions:
Output:
Recent versions:
v12 (2025-01-09 10:23:41)
Merge remote changes
[abc1234]
v11 (2025-01-09 09:15:22)
Add ControlNet workflow
[def5678]
v10 (2025-01-08 16:42:10)
Update node dependencies
[ghi9012]
Each pull creates a new version by auto-committing the merged state.
Rollback to Version¶
Restore to a previous version:
This creates a new version (v13) that matches v10's state. See Version Control for details.
Common Workflows¶
Initial Setup (Team Lead)¶
Create an environment and set up remote:
# 1. Create environment
cfd create team-env
# 2. Configure environment (add nodes, workflows, etc.)
cfd -e team-env node add rgthree-comfy
cfd -e team-env commit -m "Initial setup"
# 3. Add remote
cfd -e team-env remote add origin https://github.com/team/comfy-env.git
# 4. Push to remote
cfd -e team-env push
Team members can now clone or pull from this remote.
Daily Workflow (Team Member)¶
Stay synced with team changes:
# 1. Pull latest changes
cfd -e team-env pull
# 2. Make your changes
cfd -e team-env node add custom-node
# ... work on workflows ...
# 3. Commit your changes
cfd -e team-env commit -m "Add custom node for feature X"
# 4. Push to share with team
cfd -e team-env push
Joining Team (New Member)¶
Two options for new team members:
Option 1: Import from git
Option 2: Clone manually + pull
# Create empty environment
cfd create team-env
# Add remote
cfd -e team-env remote add origin https://github.com/team/comfy-env.git
# Pull initial state
cfd -e team-env pull
Troubleshooting¶
Push Rejected (Non-Fast-Forward)¶
Problem: Remote has commits you don't have.
Solution: Pull first, then push:
If conflicts occur during pull, resolve them manually.
Pull Fails: Detached HEAD¶
Problem: Environment is in detached HEAD state.
Solution: Return to a branch:
Authentication Repeatedly Prompts¶
Problem: Git keeps asking for credentials.
Solution: Configure credential caching:
# Cache credentials for 1 hour
git config --global credential.helper 'cache --timeout=3600'
# Or store credentials permanently (less secure)
git config --global credential.helper store
Remote Already Exists¶
Problem: Trying to add a remote that's already configured.
Solution: Remove first, then re-add:
Or update the URL directly in git:
Pull Fails: Uncommitted Workflows¶
Problem: You have unsaved workflows in ComfyUI.
Solutions:
-
Commit workflows (recommended):
-
Force pull (discards workflow changes):
Best Practices¶
Pull Before Push¶
Always pull before pushing to avoid conflicts:
Commit Frequently¶
Small, focused commits make collaboration easier:
cfd -e my-env commit -m "Add ControlNet workflow"
cfd -e my-env commit -m "Update node dependencies"
Not:
Use Descriptive Messages¶
Write clear commit messages:
- ✅ "Add SDXL txt2img workflow with ControlNet"
- ✅ "Update IPAdapter to v2.1.0"
- ❌ "Changes"
- ❌ "Update"
Communicate Major Changes¶
Before making breaking changes, coordinate with team:
- Removing widely-used nodes
- Changing ComfyUI versions
- Restructuring workflows
Use Branches for Experiments¶
Create branches for experimental work:
Merge to main when ready:
Next Steps¶
- Export and Import - One-time environment sharing
- Team Workflows - Collaboration patterns and best practices
- Version Control - Commit and rollback strategies
- Managing Custom Nodes - Update and remove nodes
Summary¶
Git remotes enable continuous collaboration:
- Remotes connect environments to shared git repositories
- Push shares your commits with the team
- Pull fetches and merges changes, reconciling your entire environment
- Requirements ensure safe operations (clean state, no conflicts)
- Reconciliation keeps nodes, packages, and workflows in sync
Use git remotes for active team development with full version history. For one-time sharing, use Export and Import.