| name | git-advanced |
| description | Advanced git operations including safe rebases, tag management, cherry-picking, and release workflows. Activates for complex git tasks, merge conflicts, or VoiceLite release management. |
Git Advanced
Advanced git workflows for VoiceLite development and release management.
When This Skill Activates
- Commands: "rebase", "cherry-pick", "force push", "delete tag", "move tag"
- Situations: "merge conflict", "detached HEAD", "undo commit", "squash commits"
- Release work: Tag management, hotfix branches, version control
- Mistakes: "Wrong commit", "committed to wrong branch", "need to undo"
Safe Rebase Workflow
NEVER rebase public branches (master, main) - Only rebase feature branches before merging.
Interactive Rebase for Clean History
git branch backup-my-feature
git rebase -i HEAD~3
git status
git add .
git rebase --continue
git rebase --abort
git reset --hard backup-my-feature
Tag Management (Critical for VoiceLite Releases)
Delete Tag (Local + Remote)
git tag -d v1.0.97
git push origin :refs/tags/v1.0.97
gh release delete v1.0.97 --yes
git tag | grep v1.0.97
git ls-remote --tags origin | grep v1.0.97
Move Tag to Different Commit
git log --oneline --graph --all | head -10
git tag -d v1.0.98
git push origin :refs/tags/v1.0.98
git tag v1.0.98 abc1234
git push origin v1.0.98
git show v1.0.98
Annotated Tags (Preferred for Releases)
git tag -a v1.0.99 -m "Release v1.0.99: Performance improvements"
git push origin v1.0.99
git show v1.0.99
Cherry-Pick Workflow
Use case: Apply specific fix from one branch to another
Scenario: Backport Fix to Older Version
git log --oneline --grep="fix transcription bug"
git checkout v1.0.95-patch
git cherry-pick abc1234
git status
git add .
git cherry-pick --continue
git cherry-pick --abort
git push origin v1.0.95-patch
Cherry-Pick Multiple Commits
git cherry-pick abc1234 def5678 ghi9012
git cherry-pick abc1234..ghi9012
Undo Commit Strategies
Just Committed - Want to Undo
git reset --soft HEAD~1
git reset HEAD~1
git reset --hard HEAD~1
Already Pushed - Want to Undo
git revert abc1234
git push origin my-feature
git reset --hard HEAD~1
git push --force origin my-feature
Committed to Wrong Branch
git branch feature-fix
git reset --hard origin/master
git checkout feature-fix
Merge Conflict Resolution
Standard Conflict Resolution
git status
<<<<<<< HEAD
Your changes
=======
Their changes
>>>>>>> branch-name
# 3. Resolve conflict (keep one, both, or hybrid)
# 4. Mark as resolved
git add resolved-file.cs
# 5. Complete merge
git commit # Or git merge --continue
Abort Merge
git merge --abort
Use Specific Version
git checkout --ours path/to/file.cs
git add path/to/file.cs
git checkout --theirs path/to/file.cs
git add path/to/file.cs
Stash Management
Save Work in Progress
git stash push -m "WIP: audio recording feature"
git stash push -u -m "WIP: with new files"
git stash list
git stash apply stash@{0}
git stash pop
git stash drop stash@{0}
git stash clear
Branch Management
Clean Up Old Branches
git branch --merged master
git branch -d feature-old
git branch -D feature-abandoned
git push origin --delete feature-old
git fetch --prune
Rename Branch
git branch -m new-branch-name
git branch -m old-name new-name
git push origin new-name
git push origin --delete old-name
Hotfix Workflow for VoiceLite
git checkout -b hotfix-1.0.97 v1.0.96
git add .
git commit -m "fix: critical transcription timeout"
git commit -am "release: v1.0.97"
git tag v1.0.97
git push origin hotfix-1.0.97 --tags
git checkout master
git merge hotfix-1.0.97
git push origin master
git branch -d hotfix-1.0.97
git push origin --delete hotfix-1.0.97
Danger Zone (Use with Extreme Caution)
Force Push Rules
NEVER force push to:
- ❌ master / main
- ❌ Shared branches
- ❌ Protected branches
Safe to force push to:
- ✅ Your own feature branches
- ✅ After explicit team agreement
git push --force-with-lease origin my-feature
git push --force origin my-feature
Rewrite History (DANGEROUS)
git filter-branch --tree-filter 'rm -f secrets.txt' HEAD
Git Troubleshooting
Detached HEAD State
git checkout -b rescue-branch
git checkout master
"Your branch has diverged"
git pull --rebase origin master
git pull origin master
git push --force-with-lease origin master
Accidentally Committed Large File
git rm --cached large-file.bin
git commit --amend --no-edit
git push --force-with-lease
Useful Git Aliases
[alias]
co = checkout
br = branch
ci = commit
st = status
lg = log --oneline --graph --all --decorate
last = log -1 HEAD
undo = reset --soft HEAD~1
unstage = reset HEAD --
cleanup = !git branch --merged | grep -v '*' | xargs -n 1 git branch -d
VoiceLite Release Tag Convention
Format: v{MAJOR}.{MINOR}.{PATCH}
Examples:
v1.0.96 - Critical hotfix (model file missing)
v1.0.95 - Broken release
v1.0.88 - Q8_0 quantization performance update
Trigger: git tag v1.0.XX && git push --tags
Result: GitHub Actions builds installer, creates release