home / skills / toilahuongg / shopify-agents-kit / git-sync
This skill helps you keep your local branch up to date with the remote by performing fetch and pull --rebase, resolving conflicts as needed.
npx playbooks add skill toilahuongg/shopify-agents-kit --skill git-syncReview the files below or copy the command above to add this skill to your agents.
---
name: git-sync
description: Sync with remote repository using pull --rebase. Use when you need to update your local branch with remote changes.
disable-model-invocation: true
allowed-tools: Bash(git:*)
---
# Git Sync
Sync local branch with remote using rebase.
1. Fetch the latest changes from the remote repository.
- Command: `git fetch origin`
2. Pull and rebase the current branch on top of the remote branch.
- Command: `git pull origin HEAD --rebase`
- If there are conflicts, resolve them, then `git rebase --continue`.
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.
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.
What if I encounter merge conflicts during rebase?
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.