git-sync_skill
- HTML
6
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill toilahuongg/shopify-agents-kit --skill git-sync- SKILL.md544 B
Overview
This skill syncs your local Git branch with the remote repository using a pull with rebase. It helps keep a clean linear history by rebasing your local commits on top of the latest remote changes. Use it when you want to update your working branch without creating merge commits.
How this skill works
The skill first fetches the latest objects and refs from the remote (git fetch origin). Then it performs a pull that rebases the current branch onto the corresponding remote HEAD (git pull origin HEAD --rebase). If rebase conflicts occur, resolve the conflicts in your files and run git rebase --continue to finish the process.
When to use it
- Before pushing local changes to ensure you base your work on the latest remote commits.
- When you prefer a linear history without merge commits on feature branches.
- In CI/CD or pre-merge workflows where rebasing is required or recommended.
- When collaborating on a shared branch where others push frequently.
Best practices
- Always commit or stash local work before fetching and rebasing to avoid losing uncommitted changes.
- Run git fetch origin first to inspect incoming changes with git log or git diff before rebasing.
- If conflicts appear, resolve them carefully, test the code, then run git rebase --continue.
- Avoid rebasing public branches that others also base work on; prefer rebasing private or feature branches.
- If rebase goes wrong, use git rebase --abort to return to the pre-rebase state.
Example use cases
- You finished a small feature locally and want to update your branch with remote changes before pushing.
- A teammate pushed fixes to the same branch; rebase your commits to place them on top of those fixes.
- Preparing a pull request and ensuring the commit history is linear and contains no merge commits.
- Automated scripts that synchronize developer branches with the remote prior to running tests.
FAQ
Open the conflicting files, resolve the conflicts, stage the changes with git add, then run git rebase --continue. Use git rebase --abort to cancel if needed.
Can I rebase a branch that others already use?
Rebasing rewrites history and can disrupt collaborators. Avoid rebasing branches shared by others; instead use merge in that case.