ace-git 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. checksums.yaml +7 -0
  2. data/.ace-defaults/git/config.yml +83 -0
  3. data/.ace-defaults/nav/protocols/guide-sources/ace-git.yml +10 -0
  4. data/.ace-defaults/nav/protocols/tmpl-sources/ace-git.yml +19 -0
  5. data/.ace-defaults/nav/protocols/wfi-sources/ace-git.yml +19 -0
  6. data/CHANGELOG.md +762 -0
  7. data/LICENSE +21 -0
  8. data/README.md +48 -0
  9. data/Rakefile +14 -0
  10. data/docs/demo/ace-git-getting-started.gif +0 -0
  11. data/docs/demo/ace-git-getting-started.tape.yml +18 -0
  12. data/docs/demo/fixtures/README.md +3 -0
  13. data/docs/demo/fixtures/sample.txt +1 -0
  14. data/docs/getting-started.md +87 -0
  15. data/docs/handbook.md +50 -0
  16. data/docs/usage.md +259 -0
  17. data/exe/ace-git +37 -0
  18. data/handbook/guides/version-control/ruby.md +41 -0
  19. data/handbook/guides/version-control/rust.md +49 -0
  20. data/handbook/guides/version-control/typescript.md +47 -0
  21. data/handbook/guides/version-control-system-git.g.md +829 -0
  22. data/handbook/skills/as-git-rebase/SKILL.md +43 -0
  23. data/handbook/skills/as-git-reorganize-commits/SKILL.md +41 -0
  24. data/handbook/skills/as-github-pr-create/SKILL.md +60 -0
  25. data/handbook/skills/as-github-pr-update/SKILL.md +41 -0
  26. data/handbook/skills/as-github-release-publish/SKILL.md +58 -0
  27. data/handbook/templates/commit/squash.template.md +59 -0
  28. data/handbook/templates/pr/bugfix.template.md +103 -0
  29. data/handbook/templates/pr/default.template.md +40 -0
  30. data/handbook/templates/pr/feature.template.md +41 -0
  31. data/handbook/workflow-instructions/git/rebase.wf.md +402 -0
  32. data/handbook/workflow-instructions/git/reorganize-commits.wf.md +158 -0
  33. data/handbook/workflow-instructions/github/pr/create.wf.md +282 -0
  34. data/handbook/workflow-instructions/github/pr/update.wf.md +199 -0
  35. data/handbook/workflow-instructions/github/release-publish.wf.md +162 -0
  36. data/lib/ace/git/atoms/command_executor.rb +253 -0
  37. data/lib/ace/git/atoms/date_resolver.rb +129 -0
  38. data/lib/ace/git/atoms/diff_numstat_parser.rb +82 -0
  39. data/lib/ace/git/atoms/diff_parser.rb +110 -0
  40. data/lib/ace/git/atoms/file_grouper.rb +152 -0
  41. data/lib/ace/git/atoms/git_scope_filter.rb +86 -0
  42. data/lib/ace/git/atoms/git_status_fetcher.rb +29 -0
  43. data/lib/ace/git/atoms/grouped_stats_formatter.rb +233 -0
  44. data/lib/ace/git/atoms/lock_error_detector.rb +79 -0
  45. data/lib/ace/git/atoms/pattern_filter.rb +156 -0
  46. data/lib/ace/git/atoms/pr_identifier_parser.rb +88 -0
  47. data/lib/ace/git/atoms/repository_checker.rb +97 -0
  48. data/lib/ace/git/atoms/repository_state_detector.rb +92 -0
  49. data/lib/ace/git/atoms/stale_lock_cleaner.rb +247 -0
  50. data/lib/ace/git/atoms/status_formatter.rb +180 -0
  51. data/lib/ace/git/atoms/task_pattern_extractor.rb +57 -0
  52. data/lib/ace/git/atoms/time_formatter.rb +84 -0
  53. data/lib/ace/git/cli/commands/branch.rb +62 -0
  54. data/lib/ace/git/cli/commands/diff.rb +252 -0
  55. data/lib/ace/git/cli/commands/pr.rb +119 -0
  56. data/lib/ace/git/cli/commands/status.rb +84 -0
  57. data/lib/ace/git/cli.rb +87 -0
  58. data/lib/ace/git/models/diff_config.rb +185 -0
  59. data/lib/ace/git/models/diff_result.rb +94 -0
  60. data/lib/ace/git/models/repo_status.rb +202 -0
  61. data/lib/ace/git/molecules/branch_reader.rb +92 -0
  62. data/lib/ace/git/molecules/config_loader.rb +108 -0
  63. data/lib/ace/git/molecules/diff_filter.rb +102 -0
  64. data/lib/ace/git/molecules/diff_generator.rb +160 -0
  65. data/lib/ace/git/molecules/git_status_fetcher.rb +32 -0
  66. data/lib/ace/git/molecules/pr_metadata_fetcher.rb +286 -0
  67. data/lib/ace/git/molecules/recent_commits_fetcher.rb +53 -0
  68. data/lib/ace/git/organisms/diff_orchestrator.rb +178 -0
  69. data/lib/ace/git/organisms/repo_status_loader.rb +264 -0
  70. data/lib/ace/git/version.rb +7 -0
  71. data/lib/ace/git.rb +230 -0
  72. metadata +201 -0
@@ -0,0 +1,829 @@
1
+ ---
2
+ doc-type: guide
3
+ title: Version Control System Git Guide
4
+ purpose: Documentation for ace-git/handbook/guides/version-control-system-git.g.md
5
+ ace-docs:
6
+ last-updated: 2026-03-12
7
+ last-checked: 2026-03-21
8
+ ---
9
+
10
+ # Version Control System Git Guide
11
+
12
+ ## Purpose
13
+
14
+ This guide provides comprehensive documentation for Git-specific version control operations and workflows. It focuses on Git command patterns, branching strategies, collaboration workflows, and troubleshooting procedures while complementing the [Version Control Message Guide](./version-control-system-message.g.md) for commit formatting standards.
15
+
16
+ ## Git Workflow Fundamentals
17
+
18
+ ### Repository Structure
19
+
20
+ This project uses a **mono-repo architecture** with all packages at the repository root:
21
+
22
+ - **ace-*/**: Ruby gems for specific functionality (ace-git, ace-taskflow, ace-docs, etc.)
23
+ - **docs/**: Project documentation and architecture decisions
24
+ - **.ace-taskflow/**: Task management and release coordination
25
+ - **_legacy/**: Archived content from previous multi-repo structure
26
+
27
+ #### Common Git Commands
28
+
29
+ ```bash
30
+ # Check repository status
31
+ git status
32
+
33
+ # View recent activity
34
+ git log --oneline -10
35
+
36
+ # Commit with conventional message
37
+ git commit -m "feat(package): description"
38
+
39
+ # Push to remote
40
+ bin/gp
41
+
42
+ # Coordinated pull across all repositories
43
+ bin/gpull
44
+ ```
45
+
46
+ ### Basic Git Operations
47
+
48
+ #### Repository Setup
49
+
50
+ ```bash
51
+ # Clone with submodules
52
+ git clone --recursive <repository-url>
53
+
54
+ # Initialize submodules in existing repository
55
+ git submodule update --init --recursive
56
+
57
+ # Check submodule status
58
+ git submodule status
59
+ ```
60
+
61
+ #### Working with Changes
62
+
63
+ ```bash
64
+ # Check repository status
65
+ git status
66
+
67
+ # Review changes
68
+ git diff # Unstaged changes
69
+ git diff --staged # Staged changes
70
+ git diff HEAD # All changes
71
+ git diff commit1..commit2 # Between commits
72
+ ```
73
+
74
+ ## Branching Strategies
75
+
76
+ ### Branch Naming Conventions
77
+
78
+ Follow consistent naming patterns for different types of work:
79
+
80
+ ```bash
81
+ # Feature development
82
+ git checkout -b feature/user-authentication
83
+ git checkout -b feature/search-functionality
84
+
85
+ # Bug fixes
86
+ git checkout -b fix/login-validation
87
+ git checkout -b fix/memory-leak
88
+
89
+ # Documentation updates
90
+ git checkout -b docs/api-documentation
91
+ git checkout -b docs/setup-guide
92
+
93
+ # Refactoring work
94
+ git checkout -b refactor/service-layer
95
+ git checkout -b refactor/error-handling
96
+ ```
97
+
98
+ ### Branch Lifecycle
99
+
100
+ #### Creating and Working on Branches
101
+
102
+ ```bash
103
+ # Create and switch to new branch
104
+ git checkout -b feature/new-feature
105
+
106
+ # Work on changes (edit files, run tests)
107
+ # Stage and commit following message standards
108
+ git add .
109
+ git commit -m "feat(auth): add user login functionality"
110
+
111
+ # Keep branch updated with main
112
+ git fetch origin
113
+ git rebase origin/main
114
+
115
+ # Push branch for collaboration
116
+ git push -u origin feature/new-feature
117
+ ```
118
+
119
+ #### Merging Strategies
120
+
121
+ **Fast-Forward Merge** (preferred for simple changes):
122
+
123
+ ```bash
124
+ git checkout main
125
+ git pull origin main
126
+ git merge feature/simple-fix
127
+ git push origin main
128
+ ```
129
+
130
+ **Squash Merge** (for feature branches with multiple commits):
131
+
132
+ ```bash
133
+ git checkout main
134
+ git pull origin main
135
+ git merge --squash feature/complex-feature
136
+ git commit -m "feat(feature): implement complex feature functionality"
137
+ git push origin main
138
+ ```
139
+
140
+ **Merge Commit** (for preserving branch history):
141
+
142
+ ```bash
143
+ git checkout main
144
+ git pull origin main
145
+ git merge --no-ff feature/important-feature
146
+ git push origin main
147
+ ```
148
+
149
+ ### Long-Running Branches
150
+
151
+ #### Main Branch Protection
152
+
153
+ - **Never force push to main**
154
+ - **Always pull before pushing**
155
+ - **Ensure tests pass before merging**
156
+ - **Use pull requests for code review**
157
+
158
+ #### Branch Cleanup
159
+
160
+ ```bash
161
+ # List merged branches
162
+ git branch --merged
163
+
164
+ # Delete local merged branches
165
+ git branch -d feature/completed-feature
166
+
167
+ # Delete remote branches
168
+ git push origin --delete feature/completed-feature
169
+
170
+ # Prune deleted remote branches
171
+ git remote prune origin
172
+ ```
173
+
174
+ ## Collaboration Workflows
175
+
176
+ ### Pull Request Process
177
+
178
+ #### Creating Pull Requests
179
+
180
+ 1. **Push your branch**:
181
+
182
+ ```bash
183
+ git push -u origin feature/your-feature
184
+ ```
185
+
186
+ 2. **Create PR through GitHub interface** or CLI:
187
+
188
+ ```bash
189
+ gh pr create --title "feat(feature): add new functionality" \
190
+ --body "Description of changes..."
191
+ ```
192
+
193
+ 3. **Link to relevant issues/tasks**:
194
+
195
+ ```markdown
196
+ Implements #task-id
197
+ Fixes #issue-number
198
+ ```
199
+
200
+ #### Code Review Integration
201
+
202
+ **Before requesting review**:
203
+
204
+ ```bash
205
+ # Run quality checks
206
+ bin/test
207
+ bin/lint
208
+ bin/build
209
+
210
+ # Update with latest changes
211
+ git fetch origin
212
+ git rebase origin/main
213
+
214
+ # Force push if rebased (use with caution)
215
+ git push --force-with-lease origin feature/your-feature
216
+ ```
217
+
218
+ ### Team Collaboration Patterns
219
+
220
+ #### Fork-Based Workflow
221
+
222
+ For external contributors:
223
+
224
+ ```bash
225
+ # Fork repository on GitHub, then:
226
+ git clone https://github.com/your-username/project.git
227
+ cd project
228
+
229
+ # Add upstream remote
230
+ git remote add upstream https://github.com/original/project.git
231
+
232
+ # Stay updated with upstream
233
+ git fetch upstream
234
+ git checkout main
235
+ git merge upstream/main
236
+ git push origin main
237
+ ```
238
+
239
+ #### Conflict Resolution in Teams
240
+
241
+ **Prevention strategies**:
242
+
243
+ - Communicate about overlapping work areas
244
+ - Keep branches short-lived and focused
245
+ - Rebase frequently against main branch
246
+ - Coordinate changes to shared files
247
+
248
+ **Resolution process**:
249
+
250
+ ```bash
251
+ # When conflicts occur during merge/rebase
252
+ git status # See conflicted files
253
+
254
+ # Edit files to resolve conflicts
255
+ # Remove conflict markers: <<<<<<<, =======, >>>>>>>
256
+
257
+ # Stage resolved files
258
+ git add resolved-file.js
259
+
260
+ # Continue rebase or complete merge
261
+ git rebase --continue
262
+ # or
263
+ git commit
264
+ ```
265
+
266
+ ## Advanced Git Operations
267
+
268
+ ### Interactive Rebase
269
+
270
+ **Cleaning up commit history**:
271
+
272
+ ```bash
273
+ # Rebase last 3 commits interactively
274
+ git rebase -i HEAD~3
275
+
276
+ # Options during interactive rebase:
277
+ # pick = use commit
278
+ # reword = change commit message
279
+ # edit = stop for amending
280
+ # squash = combine with previous commit
281
+ # fixup = like squash but discard message
282
+ # drop = remove commit
283
+ ```
284
+
285
+ **Example interactive rebase session**:
286
+
287
+ ```bash
288
+ # Before: messy commit history
289
+ # fix typo
290
+ # add feature
291
+ # fix another typo
292
+ # add tests
293
+
294
+ # After interactive rebase:
295
+ # feat(feature): add new feature with tests
296
+ ```
297
+
298
+ ### Cherry-Picking
299
+
300
+ **Applying specific commits to other branches**:
301
+
302
+ ```bash
303
+ # Apply commit from another branch
304
+ git cherry-pick <commit-hash>
305
+
306
+ # Apply range of commits
307
+ git cherry-pick <start-commit>..<end-commit>
308
+
309
+ # Cherry-pick without committing (for review)
310
+ git cherry-pick --no-commit <commit-hash>
311
+ ```
312
+
313
+ ### Git Stash
314
+
315
+ **Temporarily saving work**:
316
+
317
+ ```bash
318
+ # Stash current changes
319
+ git stash
320
+
321
+ # Stash with message
322
+ git stash push -m "work in progress on feature"
323
+
324
+ # List stashes
325
+ git stash list
326
+
327
+ # Apply most recent stash
328
+ git stash pop
329
+
330
+ # Apply specific stash
331
+ git stash apply stash@{1}
332
+
333
+ # Drop stash
334
+ git stash drop stash@{0}
335
+ ```
336
+
337
+ ## Submodule Management
338
+
339
+ ### Working with Submodules
340
+
341
+ **Updating submodules**:
342
+
343
+ ```bash
344
+ # Update all submodules to latest commits
345
+ git submodule update --remote
346
+
347
+ # Update specific submodule
348
+ git submodule update --remote shared-handbook
349
+
350
+ # Commit submodule updates
351
+ git add .gitmodules shared-handbook shared-taskflow shared-tools
352
+ git commit -m "chore(submodules): update to latest versions"
353
+ ```
354
+
355
+ **Working within submodules**:
356
+
357
+ ```bash
358
+ # Make changes in submodule
359
+ cd shared-handbook
360
+ git checkout main
361
+ git pull origin main
362
+ # Make changes, commit as usual
363
+ git commit -m "docs: update guide"
364
+ git push origin main
365
+
366
+ # Return to main repo and update reference
367
+ cd ..
368
+ git add shared-handbook
369
+ git commit -m "chore(submodule): update shared-handbook reference"
370
+ ```
371
+
372
+ ### Multi-Repository Workflows
373
+
374
+ **Coordinated development across repositories**:
375
+
376
+ ```bash
377
+ # Check status across all repos
378
+ git-status
379
+
380
+ # Make related changes in multiple repos
381
+ cd shared-handbook
382
+ # Edit guide files
383
+ git add . && git commit -m "docs: update workflow guide"
384
+
385
+ cd ../dev-taskflow
386
+ # Update task files
387
+ git add . && git commit -m "docs: update task status"
388
+
389
+ cd ..
390
+ # Update main repo references
391
+ git add .
392
+ git commit -m "chore: coordinate handbook and taskflow updates"
393
+
394
+ # Push all changes
395
+ bin/gp
396
+ ```
397
+
398
+ ## Git Hooks and Automation
399
+
400
+ ### Pre-commit Hooks
401
+
402
+ **Validation before commits**:
403
+
404
+ ```bash
405
+ #!/bin/sh
406
+ # .git/hooks/pre-commit
407
+
408
+ # Run tests
409
+ if ! bin/test; then
410
+ echo "Tests failed. Commit aborted."
411
+ exit 1
412
+ fi
413
+
414
+ # Run linting
415
+ if ! bin/lint; then
416
+ echo "Linting failed. Commit aborted."
417
+ exit 1
418
+ fi
419
+
420
+ echo "Pre-commit checks passed."
421
+ ```
422
+
423
+ **Commit message validation**:
424
+
425
+ ```bash
426
+ #!/bin/sh
427
+ # .git/hooks/commit-msg
428
+
429
+ commit_regex='^(feat|fix|docs|style|refactor|test|chore)(\(.+\))?: .{1,50}'
430
+
431
+ if ! grep -qE "$commit_regex" "$1"; then
432
+ echo "Invalid commit message format."
433
+ echo "Please follow: <type>(<scope>): <subject>"
434
+ echo "See: guides/version-control-system-message.g.md"
435
+ exit 1
436
+ fi
437
+ ```
438
+
439
+ ### Automation Integration
440
+
441
+ **CI/CD Integration patterns**:
442
+
443
+ ```yaml
444
+ # .github/workflows/main.yml
445
+ name: CI
446
+ on: [push, pull_request]
447
+
448
+ jobs:
449
+ test:
450
+ runs-on: ubuntu-latest
451
+ steps:
452
+ - uses: actions/checkout@v3
453
+ with:
454
+ submodules: recursive
455
+
456
+ - name: Run tests
457
+ run: bin/test
458
+
459
+ - name: Run linting
460
+ run: bin/lint
461
+ ```
462
+
463
+ ## Release Management
464
+
465
+ ### Semantic Versioning with Git Tags
466
+
467
+ **Creating releases**:
468
+
469
+ ```bash
470
+ # Update version files
471
+ # Edit CHANGELOG.md with release notes
472
+
473
+ # Commit version changes
474
+ git add version.rb CHANGELOG.md
475
+ git commit -m "chore(release): prepare v1.2.0 publication"
476
+
477
+ # Create annotated tag
478
+ git tag -a v1.2.0 -m "Release v1.2.0 - Feature Release"
479
+
480
+ # Verify tag
481
+ git tag -l v1.2.0
482
+ git show v1.2.0
483
+
484
+ # Push release
485
+ git push origin main
486
+ git push origin v1.2.0
487
+ ```
488
+
489
+ **Release branch workflow**:
490
+
491
+ ```bash
492
+ # Create release branch
493
+ git checkout -b release/v1.2.0
494
+
495
+ # Finalize release changes
496
+ # Update versions, documentation
497
+ git commit -m "chore(release): finalize v1.2.0"
498
+
499
+ # Merge to main
500
+ git checkout main
501
+ git merge --no-ff release/v1.2.0
502
+ git tag -a v1.2.0 -m "Release v1.2.0"
503
+
504
+ # Clean up
505
+ git branch -d release/v1.2.0
506
+ git push origin main --tags
507
+ ```
508
+
509
+ ### Documentation Archival
510
+
511
+ **Archiving release documentation**:
512
+
513
+ ```bash
514
+ # Move completed release docs
515
+ mv dev-taskflow/current/v1.2.0-release dev-taskflow/done/
516
+
517
+ # Commit archival
518
+ git add dev-taskflow/
519
+ git commit -m "chore(release): archive v1.2.0 documentation"
520
+
521
+ # Create new current release structure
522
+ mkdir -p dev-taskflow/current/v1.3.0-next
523
+ git add dev-taskflow/current/
524
+ git commit -m "chore(release): initialize v1.3.0 development"
525
+ ```
526
+
527
+ ## Troubleshooting Common Issues
528
+
529
+ ### Merge Conflicts
530
+
531
+ **Identifying conflicts**:
532
+
533
+ ```bash
534
+ # Check status during merge conflict
535
+ git status
536
+
537
+ # See which files have conflicts
538
+ git diff --name-only --diff-filter=U
539
+ ```
540
+
541
+ **Resolving conflicts**:
542
+
543
+ ```bash
544
+ # Manual resolution
545
+ # Edit files to remove conflict markers:
546
+ # <<<<<<< HEAD
547
+ # =======
548
+ # >>>>>>> branch-name
549
+
550
+ # Stage resolved files
551
+ git add resolved-file.js
552
+
553
+ # Continue merge or rebase
554
+ git rebase --continue
555
+ # or complete merge
556
+ git commit
557
+ ```
558
+
559
+ **Aborting problematic merges**:
560
+
561
+ ```bash
562
+ # Abort merge
563
+ git merge --abort
564
+
565
+ # Abort rebase
566
+ git rebase --abort
567
+
568
+ # Reset to clean state
569
+ git reset --hard HEAD
570
+ ```
571
+
572
+ ### Authentication Issues
573
+
574
+ **SSH key problems**:
575
+
576
+ ```bash
577
+ # Test SSH connection
578
+ ssh -T git@github.com
579
+
580
+ # Add SSH key to agent
581
+ ssh-add ~/.ssh/id_rsa
582
+
583
+ # Check SSH agent
584
+ ssh-add -l
585
+ ```
586
+
587
+ **HTTPS token issues**:
588
+
589
+ ```bash
590
+ # Update stored credentials (macOS)
591
+ git config --global credential.helper osxkeychain
592
+
593
+ # Clear cached credentials
594
+ git config --global --unset credential.helper
595
+ git config --system --unset credential.helper
596
+ ```
597
+
598
+ ### Repository Corruption
599
+
600
+ **Checking repository integrity**:
601
+
602
+ ```bash
603
+ # Check for corruption
604
+ git fsck --full
605
+
606
+ # Verify objects
607
+ git count-objects -v
608
+
609
+ # Clean up loose objects
610
+ git gc --aggressive
611
+ ```
612
+
613
+ **Recovering lost commits**:
614
+
615
+ ```bash
616
+ # Find lost commits
617
+ git reflog
618
+
619
+ # Recover commit
620
+ git checkout <commit-hash>
621
+ git checkout -b recovery-branch
622
+
623
+ # Or create new branch from reflog
624
+ git branch recovery <commit-hash>
625
+ ```
626
+
627
+ ### Large File Issues
628
+
629
+ **Identifying large files**:
630
+
631
+ ```bash
632
+ # Find large files in history
633
+ git rev-list --objects --all | \
634
+ git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' | \
635
+ awk '/^blob/ {print substr($0,6)}' | \
636
+ sort --numeric-sort --key=2 | \
637
+ tail -20
638
+ ```
639
+
640
+ **Git LFS setup**:
641
+
642
+ ```bash
643
+ # Install Git LFS
644
+ git lfs install
645
+
646
+ # Track large file types
647
+ git lfs track "*.zip"
648
+ git lfs track "*.pdf"
649
+
650
+ # Add .gitattributes
651
+ git add .gitattributes
652
+ git commit -m "chore: configure Git LFS for large files"
653
+ ```
654
+
655
+ ### Performance Optimization
656
+
657
+ **Optimizing large repositories**:
658
+
659
+ ```bash
660
+ # Clean up repository
661
+ git gc --aggressive --prune=now
662
+
663
+ # Enable partial clone for large repos
664
+ git clone --filter=blob:none <url>
665
+
666
+ # Shallow clone for CI
667
+ git clone --depth 1 <url>
668
+ ```
669
+
670
+ **Submodule performance**:
671
+
672
+ ```bash
673
+ # Parallel submodule updates
674
+ git submodule update --init --recursive --jobs 4
675
+
676
+ # Shallow submodule clones
677
+ git submodule update --init --recursive --depth 1
678
+ ```
679
+
680
+ ## Security and Compliance
681
+
682
+ ### Signed Commits
683
+
684
+ **Setting up GPG signing**:
685
+
686
+ ```bash
687
+ # Generate GPG key
688
+ gpg --gen-key
689
+
690
+ # List keys
691
+ gpg --list-secret-keys --keyid-format LONG
692
+
693
+ # Configure Git to use GPG key
694
+ git config --global user.signingkey <key-id>
695
+ git config --global commit.gpgsign true
696
+
697
+ # Sign commits
698
+ git commit -S -m "feat(security): add GPG signing"
699
+ ```
700
+
701
+ ### Sensitive Data Handling
702
+
703
+ **Preventing sensitive data commits**:
704
+
705
+ ```bash
706
+ # Add to .gitignore
707
+ echo "*.env" >> .gitignore
708
+ echo "secrets/" >> .gitignore
709
+ echo "*.key" >> .gitignore
710
+
711
+ # Use git-secrets tool
712
+ git secrets --register-aws
713
+ git secrets --install
714
+ ```
715
+
716
+ **Removing sensitive data from history**:
717
+
718
+ ```bash
719
+ # Use git filter-branch (destructive)
720
+ git filter-branch --force --index-filter \
721
+ "git rm --cached --ignore-unmatch path/to/sensitive-file" \
722
+ --prune-empty --tag-name-filter cat -- --all
723
+
724
+ # Use BFG Repo Cleaner (recommended)
725
+ bfg --delete-files sensitive-file.txt
726
+ git reflog expire --expire=now --all && git gc --prune=now --aggressive
727
+ ```
728
+
729
+ ### Access Control
730
+
731
+ **Repository permissions**:
732
+
733
+ - Use branch protection rules
734
+ - Require pull request reviews
735
+ - Enforce status checks
736
+ - Restrict push access to main branch
737
+
738
+ **Audit trails**:
739
+
740
+ ```bash
741
+ # Review commit history
742
+ git log --author="user@example.com" --oneline
743
+
744
+ # Check file history
745
+ git log --follow -- path/to/file
746
+
747
+ # Review tag history
748
+ git for-each-ref --format="%(refname) %(taggerdate) %(taggername)" refs/tags
749
+ ```
750
+
751
+ ## Best Practices Summary
752
+
753
+ ### Repository Hygiene
754
+
755
+ 1. **Keep commits atomic**: One logical change per commit
756
+ 2. **Write descriptive commit messages**: Follow [conventional commit standards](./version-control-system-message.g.md)
757
+ 3. **Test before committing**: Run `bin/test` and `bin/lint`
758
+ 4. **Keep branches focused**: One feature or fix per branch
759
+ 5. **Clean up branches**: Delete merged branches regularly
760
+
761
+ ### Collaboration Excellence
762
+
763
+ 1. **Pull before pushing**: Always sync with remote changes
764
+ 2. **Rebase for clean history**: Use interactive rebase to clean up commits
765
+ 3. **Review code thoroughly**: Use pull requests for all changes
766
+ 4. **Communicate conflicts**: Coordinate on overlapping work areas
767
+ 5. **Document decisions**: Use commit messages to explain why, not just what
768
+
769
+ ### Security and Compliance
770
+
771
+ 1. **Never commit secrets**: Use environment variables and secure storage
772
+ 2. **Sign important commits**: Use GPG signing for releases and security fixes
773
+ 3. **Review history**: Regularly audit commits for sensitive information
774
+ 4. **Use branch protection**: Protect main branches with required reviews
775
+ 5. **Monitor access**: Track who has push access to critical branches
776
+
777
+ ### Multi-Repository Coordination
778
+
779
+ 1. **Use project scripts**: Leverage `git-commit`, `git-status`, `git-log` for coordination
780
+ 2. **Coordinate related changes**: Update submodules and main repo together
781
+ 3. **Test across repositories**: Ensure changes work across the full system
782
+ 4. **Document cross-repo changes**: Explain relationships in commit messages
783
+ 5. **Sync submodule updates**: Keep submodule references current
784
+
785
+ ## Related Documents
786
+
787
+ - [Version Control Message Guide](./version-control-system-message.g.md) - Commit message formatting standards
788
+ - [Commit Workflow](../workflow-instructions/commit.wf.md) - Step-by-step commit process
789
+ - [Code Review Process](./code-review-process.g.md) - Review procedures and quality gates
790
+ - [Quality Assurance Guide](./quality-assurance.g.md) - Testing and validation standards
791
+
792
+ ## Tools and Automation
793
+
794
+ ### Project-Specific Commands
795
+
796
+ - `git-commit -i "intention"` - Multi-repository commit with contextual messages
797
+ - `git-status` - Status check across all repositories
798
+ - `git-log` - Unified log view across repositories
799
+ - `bin/gp` - Coordinated push to all repositories
800
+ - `bin/gpull` - Coordinated pull from all repositories
801
+
802
+ ### Recommended Git Configuration
803
+
804
+ ```bash
805
+ # Set up useful Git aliases
806
+ git config --global alias.st "status"
807
+ git config --global alias.co "checkout"
808
+ git config --global alias.br "branch"
809
+ git config --global alias.ci "commit"
810
+ git config --global alias.unstage "reset HEAD --"
811
+ git config --global alias.last "log -1 HEAD"
812
+ git config --global alias.visual "!gitk"
813
+
814
+ # Configure line ending handling
815
+ git config --global core.autocrlf input
816
+
817
+ # Set default branch name
818
+ git config --global init.defaultBranch main
819
+
820
+ # Configure pull behavior
821
+ git config --global pull.rebase false
822
+ ```
823
+
824
+ ## References
825
+
826
+ - [Pro Git Book](https://git-scm.com/book) - Comprehensive Git documentation
827
+ - [GitHub Flow](https://guides.github.com/introduction/flow/) - Simplified branching workflow
828
+ - [Atlassian Git Tutorials](https://www.atlassian.com/git/tutorials) - Visual Git learning resources
829
+ - [Conventional Commits](https://www.conventionalcommits.org/) - Commit message specification