Przejdź do treści
Biblioteka skilli
Programowanie · Automatyzacja

git-workflows

/git-workflows

Obsługuje gałęzie, commity, synchronizację, scalanie, rebase, cherry-picki, konflikty i odzyskiwanie repozytorium.

Licencja
MIT
Ostatnia zmiana repozytorium
05.11.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 05.11.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Obsługuje gałęzie, commity, synchronizację, scalanie, rebase, cherry-picki, konflikty i odzyskiwanie repozytorium.

Oryginalny opis (EN)

Use when handling Git branches, commits, synchronization, merges, rebases, cherry-picks, conflict resolution, or repository recovery.

Jak działa

  1. Safety first
  2. Inspect before acting
  3. Normal feature workflow
  4. Conflict and interrupted-operation recovery
  5. Recovery after lost or rewritten work
  6. Commands that can discard or rewrite work
  7. Completion checklist
Sekcje z nagłówków SKILL.md, w oryginale · 104 linii, 1 013 słów
Podgląd SKILL.md
---
name: git-workflows
description: Use when handling Git branches, commits, synchronization, merges, rebases, cherry-picks, conflict resolution, or repository recovery.
---

# Git Workflows

## Safety first

Do not commit, push, rewrite shared history, or discard work unless the user explicitly authorized that operation. Preserve existing changes. Before any history-changing or destructive action, explain its effect, inspect the affected state, and establish a recovery point. For task planning beyond Git operations, use [fullstack-core](../fullstack-core/SKILL.md); for reviewing the resulting code diff, use [code-review](../code-review/SKILL.md).

## Inspect before acting

Start with read-only inspection:

```bash
git status --short --branch  # Current branch and worktree/index state.
git diff                    # Unstaged tracked changes.
git diff --cached           # Staged changes.
git log --oneline --decorate -n 10
git branch -vv              # Local branches and tracking relationships.
```

Identify untracked files too (`git status --short`), the intended base/target branch, remote tracking state, and whether work is shared. Do not assume `main`, a remote name, or a clean worktree. If the requested operation could overwrite uncommitted work, pause and agree on a preservation plan first.

## Normal feature workflow

1. Confirm the repository's contribution instructions, intended base branch, and user authorization for branch, commit, remote, merge, or rebase operations.
2. Create a feature branch when requested and appropriate, from the agreed base. Example: `git switch -c feature/short-name` creates and switches to a new branch; check that the name is unused and preserve any current work first.
3. To synchronize, fetch the agreed remote (for example `git fetch origin`). Fetch updates remote-tracking refs but does not move the current branch or change worktree files. Replace `origin/main` below with the actual target and inspect divergence before integrating:

   ```bash
   git log --oneline --left-right HEAD...origin/main
   ```

   Choose one integration method according to project policy and the user's authorization. Merge option:

   ```bash
   git merge origin/main
   ```

   Rebase option (replays local commits and rewrites their IDs):

   ```bash
   git rebase origin/main
   ```

   Avoid rebasing a branch others may use unless coordinated; do not run both methods for the same synchronization.
4. Before staging, inspect `git status`, `git diff`, and relevant untracked files. Stage only intended paths, e.g. `git add -- path/to/file`; then inspect `git diff --cached` and run `git diff --cached --check` before a commit. Never stage secrets, generated artifacts, or unrelated user work.
5. Run relevant tests and checks before any authorized commit or push. Commit only when requested, for example `git commit -m "short change summary"`. Afterward inspect `git status`, the final diff, and resulting history. Report exact operations and checks performed.

## Conflict and interrupted-operation recovery

When Git reports conflicts, identify the operation and inspect the affected paths before editing:

```bash
git status
git diff --name-only --diff-filter=U  # Unmerged paths.
git diff -- path/to/conflicted-file   # Inspect conflict context.
```

Resolve each file based on intended behavior, not by choosing “ours” or “theirs” wholesale. Review the complete result, stage only resolved files, run relevant tests and `git diff --check`, then continue the operation that is actually in progress:

```bash
git merge --continue
git rebase --continue
git cherry-pick --continue
git revert --continue
```

Use only the matching continuation command. To stop an operation, its corresponding `--abort` command (such as `git merge --abort`, `git rebase --abort`, `git cherry-pick --abort`, or `git revert --abort`) attempts to restore the state from before it began; first inspect and preserve pre-existing work because abort may not reconstruct a dirty starting tree exactly. Do not delete lock/state files or reset paths to “fix” an interrupted operation. Recheck `git status` before deciding whether to continue or abort.

For a revert, inspect the target commit and its effects first. `git revert` creates a new inverse commit rather than erasing history, but the inverse may conflict or be unsafe if later work depends on the change. Review the resulting diff and tests before continuing, and perform it only when authorized.

## Recovery after lost or rewritten work

The reflog can help locate commits and previous branch tips; it does not record arbitrary uncommitted file contents. Do not promise reflog recovery for uncommitted edits when no saved copy exists.

1. Stop issuing write/history commands. Inspect `git status`, `git reflog --date=local -n 20`, and relevant `git log` entries.
2. Inspect a candidate commit before restoring anything. Set `CANDIDATE_REF` to the ref found in the reflog, then review it:

   ```bash
   CANDIDATE_REF=replace-with-reviewed-ref
   git show --stat "$CANDIDATE_REF"
   git show "$CANDIDATE_REF" -- path/to/file
   ```

3. Preserve a promising commit with a new recovery branch before further changes, for example `git branch rescue/recovered-work "$CANDIDATE_REF"`. This adds a reference without moving the current branch; choose an unused branch name.
4. Compare the recovery point with the current branch and recover only the required commits or paths. Verify worktree, index, branch, and tests afterward. If the reflog does not show the work, avoid claiming recovery is possible; check other clones/backups with the owner.

## Commands that can discard or rewrite work

Explain and inspect before using any of these; they are not generic cleanup steps:

- `git restore --staged` with a specific path unstages it while retaining its worktree content. `git restore --worktree` with a specific path replaces its unstaged content from the index and discards those edits.
- `git reset --soft` to a selected commit moves the branch but leaves the index/worktree; `git reset --mixed` also resets the index; `git reset --hard` resets tracked index/worktree content and can discard changes. Inspect the target and diffs first.
- `git clean -nfd` is a preview; `git clean -fd` deletes untracked files/directories, and adding `-x` includes ignored files. Review the preview and protect needed data before any deletion.
- `git rebase` changes commit identities. A force push can replace remote history; `--force-with-lease` checks the remote has not advanced unexpectedly but still rewrites it. Coordinate and obtain explicit authorization before either.

Prefer narrow, reversible steps. If a destructive operation is explicitly requested, state exactly what it will remove or rewrite, verify backups/recovery options, and get confirmation before proceeding.

## Completion checklist

- Initial branch, staged/unstaged/untracked state, and target were understood; user changes were preserved.
- Conflicts or recovery steps were based on intent and the final diff/history were inspected.
- Any destructive or history-rewriting command was explained and explicitly authorized.
- Resulting branch/worktree state and relevant check outcomes were verified and reported.

Wersje

RepozytoriumWynikLicencja
Ta strona · sudeeppatgar/fullstack-skills100MIT
AutumnsGrove/Lattice100AGPL-3.0
rnavarych/alpha-engineer100MIT

Migawka bazy z 13.11.2026 · wersja paczki 81e9b534be04 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 90git-merge
    Rozwiązuje złożone operacje Git: konflikty przy merge, cherry-picki i rebase.
  • 100git-workflow
    Obsługuje gałęzie, commity, PR i wydania w Git oraz trudne operacje: interaktywny rebase, cherry-pick, bisect i odzyskiwanie z reflog.
  • 100git-workflow
    Obsługuje operacje Git: gałęzie, commity, pull requesty, wydania, merge, rebase, cherry-pick, tagi i zarządzanie historią.
  • 100git
    Obsługuje pełny lokalny przepływ pracy w Git: status, commity, gałęzie, merge i rebase, konflikty, stash, historię, tagi, worktree, cherry-pick i odzyskiwanie przez reflog.
  • 100git-workflow
    Prowadzi zdyscyplinowane operacje git: gałęzie, commity, pull requesty i odzyskiwanie, przy poleceniach takich jak commit, merge, rebase, cherry-pick i tag.
  • 95git-workflow
    Prowadzi workflow Gita: commity, gałęzie, scalanie, współpracę i rozwiązywanie konfliktów w repozytoriach.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.