pact push
Commit and push changes to GitHub
pact push
Commit and push your local changes to GitHub.
Usage
pact push [flags]Flags
| Flag | Type | Description |
|---|---|---|
-m, --message | string | Commit message |
--force | bool | Force push (not implemented) |
Examples
Push with default message
pact pushUses the default commit message: "Update pact configuration"
Push with custom message
pact push -m "Add nvim keybindings"
pact push --message "Update shell aliases for new project"What it Does
- Checks initialization: Verifies pact is initialized
- Gets token: Retrieves your GitHub token from keychain
- Checks for changes: Uses
git statusto detect changes - Prompts for message: If no
-mflag, prompts for commit message - Commits: Stages all changes and commits
- Pushes: Pushes to the remote
my-pactrepo
Example Output
$ pact push -m "Add lazygit config"
Checking for changes...
✓ Found 2 changed files
Committing changes...
✓ Committed: Add lazygit config
Pushing to GitHub...
✓ Pushed successfullyNo Changes
If there are no changes to push:
$ pact push
Checking for changes...
✓ No changes to pushGit Commit Author
Pact uses your git configuration for the commit author:
# Set your git identity
git config --global user.name "Your Name"
git config --global user.email "you@example.com"If git config is not set, Pact falls back to:
- Name:
pact - Email:
pact@users.noreply.github.com
Workflow
A typical workflow for making changes:
# Edit your configuration
pact edit shell/zshrc
# Make your changes...
# Push to GitHub
pact push -m "Add Docker aliases"
# On another machine
pact sync shellUse descriptive commit messages so you can track what changed when reviewing your pact history on GitHub.
Pushing from Web Editor
When using pact edit web, you can push changes directly from the browser without using the CLI.
Troubleshooting
"No changes to push"
Make sure you've saved your files. Check git status in your .pact/ directory:
cd .pact
git status"Authentication failed"
Your GitHub token may have expired. Re-authenticate:
pact nuke
pact init"Remote rejected"
Someone may have pushed changes from another machine. Pull first:
pact sync
pact push -m "Your message"