Skip to content

Latest commit

 

History

History
67 lines (52 loc) · 1.92 KB

File metadata and controls

67 lines (52 loc) · 1.92 KB

⚠️ GIT SAFETY RULES - MANDATORY

THESE RULES ARE ABSOLUTE. NEVER EXCEPTIONS.

FORBIDDEN OPERATIONS

NEVER RUN:

  • git gc --prune=now or git gc --prune
  • git reflog expire --expire=now --all
  • git reflog expire --all
  • git filter-branch (any variant)
  • git replace (for history rewriting)
  • git rebase -i (interactive rebase on shared/pushed commits)
  • git reset --hard without explicit user confirmation
  • git push --force or git push -f
  • rm -rf .git (under ANY circumstances)

IF SOMETHING GOES WRONG

DO THIS INSTEAD:

  1. Stop immediately
  2. Run: git reflog and git fsck --lost-found
  3. Ask the user: "What do you want me to do?"
  4. Wait for explicit instruction before proceeding
  5. Describe the problem clearly with examples

SAFE OPERATIONS ONLY

These are safe to use:

  • git log
  • git show
  • git diff
  • git status
  • git branch
  • git reset --soft (only if user explicitly requests)
  • git commit (after user stages changes)
  • git add / git stage
  • git checkout (switching branches)
  • git fetch
  • git push (non-force)

COMMIT RULES

BEFORE COMMITTING:

  1. Verify branch is correct: git branch
  2. Verify no unintended changes: git status and git diff --cached
  3. Verify commit message is clear and follows feat(scope): format
  4. PAUSE and ask if anything looks wrong

NEVER:

  • Squash commits without explicit user request
  • Reorder commits
  • Modify commit messages without permission
  • Commit to master directly

IF YOU CORRUPT THE REPO

You have destroyed work. Acknowledge it and help recover:

  1. Check if remote has the branch (git branch -r)
  2. If yes: git fetch origin <branch> and restore
  3. If no: Data is lost. Apologize and rebuild work with user guidance

Remember: Destructive git operations are PERMANENT when reflogs are deleted and gc prunes.


See also: .github_project_infrastructure.md for build system and toolchain details.