← スキル一覧に戻る

git-workflow
by TrevorS
⭐ 2🍴 0📅 2026年1月24日
SKILL.md
name: git-workflow description: Handle squashing multiple commits and rebasing feature branches safely. Use when consolidating commits into a single commit, or rebasing feature branches onto updated development branches. Falls back from jj when not available.
Git Workflow
Safe, non-interactive approaches for squashing commits and rebasing feature branches.
Tip: If jj is available (
jj rootsucceeds), prefer jj-workflow—it's simpler and has automatic safety via oplog.
Squash N Commits
git reset --soft HEAD~3
git commit -m "Your consolidated message"
That's it. The --soft flag keeps your changes staged and ready to commit.
Rebase Feature Branch
Update dev first, then rebase:
git fetch origin dev && git checkout dev && git pull
git checkout my-feature
git rebase --committer-date-is-author-date dev
git push -f origin my-feature
The --committer-date-is-author-date flag puts your feature commits on top chronologically.
Key Safety Rules
- Never rebase shared branches — only rebase local feature branches
- Check
git statusfirst — ensure no uncommitted changes - Create a backup branch:
git branch backup-$(date +%s) - Review changes before committing:
git diff --cached
Pre-Commit Hook Changes
If hooks modify files during commit, stage and amend:
git add .
git commit --amend --no-edit
When Things Go Wrong
git rebase --abort # Stop rebase, go back
git reflog # See recent commits
git reset --hard <commit-hash> # Recovery
See REFERENCE.md for detailed workflows and troubleshooting.
スコア
総合スコア
50/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です