# Git Workflow

> Handles git operations including commit with locking and syncing with remote. Use for committing changes or syncing with origin.

- Skill: `tomevault-io/git-workflow-10` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/git-workflow-10`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/git-workflow-10/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Productivity
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/git-workflow-10

---


# Git Workflow

This skill handles git operations securely using mutex locking for commits to prevent concurrency issues.

## 1. Commit Changes

### Context
- **Locking**: Uses `.git-commit.lock` to ensure exclusive access.
- **Scope**: commits should only include files changed in the current task.

### Instructions

1. **Acquire Lock**:
   ```powershell
   .\.agent\skills\git-workflow\scripts\acquire-commit-lock.ps1
   if ($LASTEXITCODE -ne 0) { throw "Failed to acquire commit lock" }
   ```

2. **Analyze Changes**:
   - Verify status and diffs.
   - Stage ONLY relevant files (don't use `git add .`).

3. **Execute Commit**:
   ```powershell
   # Single Line
   .\.agent\skills\git-workflow\scripts\execute-git-commit.ps1 -Files @("file1", "file2") -Message "Commit message."
   
   # Multi Line
   .\.agent\skills\git-workflow\scripts\execute-git-commit.ps1 -Files @("file1", "file2") -Message "Title" -AdditionalMessages @("Details")
   ```

## 2. Sync with Remote

### Instructions

1. **Check State**: `git status`, `git log`
2. **Pre-Sync**: Ensure clean working tree (commit or stash).
3. **Fetch & Pull**:
   ```powershell
   git fetch origin
   git pull --rebase origin main
   ```
4. **Push**:
   ```powershell
   git push origin main
   ```
5. **Combined (Quick)**:
   ```powershell
   git fetch origin && git pull --rebase origin main && git push origin main
   ```

---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/tedd) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-14 -->

