Skip to content

Commit d4962e5

Browse files
nkoji21claude
andauthored
fix(agents): fix git apply staging — use --cached to apply to index (#78)
Co-authored-by: Claude <noreply@anthropic.com>
1 parent 9688ba2 commit d4962e5

2 files changed

Lines changed: 14 additions & 14 deletions

File tree

.agents/skills/git-commit-ja/SKILL.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,16 @@ Never use interactive commands like `git add -p`. Instead:
3030
git diff > patch.diff
3131

3232
# 2. Verify before applying (no file changes on failure)
33-
git apply --check patch.diff
33+
git apply --cached --check patch.diff
3434

35-
# 3. Apply
36-
git apply -v patch.diff
35+
# 3. Apply to staging area (equivalent to git add)
36+
git apply --cached patch.diff
3737
```
3838

39-
If `git apply` fails, try in order:
40-
1. `git apply --whitespace=fix patch.diff`
41-
2. `git apply --ignore-space-change patch.diff`
42-
3. `git apply --reject patch.diff` → manually resolve `.rej` files
39+
If `git apply --cached` fails, try in order:
40+
1. `git apply --cached --whitespace=fix patch.diff`
41+
2. `git apply --cached --ignore-space-change patch.diff`
42+
3. Fall back to `git add <files>` for the specific files
4343

4444
## Commit Message Format
4545
Conventional Commits v1.0.0

.agents/skills/git-commit/SKILL.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,16 @@ Never use interactive commands like `git add -p`. Instead:
3030
git diff > patch.diff
3131

3232
# 2. Verify before applying (no file changes on failure)
33-
git apply --check patch.diff
33+
git apply --cached --check patch.diff
3434

35-
# 3. Apply
36-
git apply -v patch.diff
35+
# 3. Apply to staging area (equivalent to git add)
36+
git apply --cached patch.diff
3737
```
3838

39-
If `git apply` fails, try in order:
40-
1. `git apply --whitespace=fix patch.diff`
41-
2. `git apply --ignore-space-change patch.diff`
42-
3. `git apply --reject patch.diff` → manually resolve `.rej` files
39+
If `git apply --cached` fails, try in order:
40+
1. `git apply --cached --whitespace=fix patch.diff`
41+
2. `git apply --cached --ignore-space-change patch.diff`
42+
3. Fall back to `git add <files>` for the specific files
4343

4444
## Commit Message Format
4545
Conventional Commits v1.0.0

0 commit comments

Comments
 (0)