Przejdź do treści
Biblioteka skilli
Programowanie · Automatyzacja

git-merge-into-main

/git-merge-into-main

Scala gotową, zrecenzowaną i zacommitowaną gałąź do gałęzi domyślnej w repozytorium, które integruje się wprost do main, bez pull requesta.

Repozytorium
agent-toolkit ↗
Licencja
MIT
Ostatnia zmiana repozytorium
27.10.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 27.10.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

Scala gotową, zrecenzowaną i zacommitowaną gałąź do gałęzi domyślnej w repozytorium, które integruje się wprost do main, bez pull requesta.

Oryginalny opis (EN)

Use when a finished, reviewed branch is committed and needs to be merged into the default branch in a repo that integrates directly to `main` (not via pull request).

Jak działa

  1. Process
  2. Rationalizations
Sekcje z nagłówków SKILL.md, w oryginale · 45 linii, 513 słów
Podgląd SKILL.md
---
name: git-merge-into-main
description: Use when a finished, reviewed branch is committed and needs to be merged into the default branch in a repo that integrates directly to `main` (not via pull request).
---

# Merge Into Main

Merges a finished branch into the default branch (e.g. `main`) by rebasing it on top, then fast-forwarding. For personal repos that integrate directly to `main` rather than through pull requests.

This skill does no reviewing and creates no commits.

## Process

1. **Check preconditions:** The branch must be committed with no unstaged files. It must also be reviewed by the user (not the same as a pull request review). Stop if either is missing.

2. **Rebase onto the default branch:** Find the default branch with `git default-branch`, then rebase the branch onto it. Always rebase, even for a trivial branch. Resolve any conflicts before continuing — do not `--skip` or force past them.

3. **Fast-forward and push:** Advance the default branch to the rebased branch with a fast-forward only (no merge commit), then push. If the default branch is checked out in another worktree, run the update from that worktree's directory — Git refuses to move a branch that is checked out elsewhere.

4. **Delete the merged branch:** Once the default branch has the commits, delete the branch with `git branch -d <branch>` (the `-d` refuses if it isn't fully merged, so it's a safety check). Run it from the default-branch worktree, never from inside the branch's own worktree.

   Git won't delete a branch that is checked out anywhere, so free it first. If the branch has a worktree that is no longer needed, remove it with `git worktree remove <branch-worktree>`. If something else owns that worktree's lifecycle — the `ls-agent:close-workspace` skill removes herdr worktrees itself — leave it in place and detach it instead with `git -C <branch-worktree> checkout --detach`.

   If the branch was pushed, also delete the remote with `git push origin --delete <branch>`.

```bash
default_branch=$(git default-branch)

git rebase "$default_branch"
git -C <default-branch-worktree> merge --ff-only <branch>
git -C <default-branch-worktree> push origin "$default_branch"

git -C <default-branch-worktree> worktree remove <branch-worktree>   # or checkout --detach, if the worktree stays
git -C <default-branch-worktree> branch -d <branch>
```

## Rationalizations

| Thought                                            | Reality                                                                     |
| -------------------------------------------------- | --------------------------------------------------------------------------- |
| "The branch is simple, I'll skip the rebase"       | Always rebase onto the default branch first, so the fast-forward is clean.  |
| "The rebase conflicted, I'll `--skip` or force"    | Resolve the conflict properly. Never discard commits to get past it.        |
| "I'll just merge it, a merge commit is fine"       | Fast-forward only. This skill keeps history linear.                         |
| "`main` won't move, I'll update it from here"      | If it's checked out in another worktree, update it from that worktree.      |
| "There are uncommitted changes, I'll merge anyway" | The branch must be committed and reviewed first. Stop.                      |
| "I'll remove the worktree while I'm in it"         | Run the removal from the default-branch worktree, or you delete your cwd.   |
| "Every merged branch's worktree should go"         | Leave the ones another skill owns. Detach those instead of removing them.   |
| "I'll leave the merged branch lying around"        | Delete it after the push; `-d` keeps it safe by refusing unmerged branches. |

Wersje

W bazie nie ma innych skilli o nazwie git-merge-into-main.

Migawka bazy z 13.11.2026 · wersja paczki af64db7d5e55 (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

  • 100open-pr
    Doprowadza gotową gałąź do scalenia: otwiera pull request do domyślnej gałęzi, a po recenzji koleżanki lub kolegi scala go i sprząta.
  • 90merge-to-main
    Prowadzi gałąź do scalenia z główną wersją, a lokalne i zdalne repozytorium wracają na main w zgodzie.
  • 100merged
    Porządkuje sesję, gałąź i lokalne main po scaleniu pull requesta, gdy użytkownik zgłasza, że PR jest już zmergowany.
  • 90commit-push-main
    Commituje i wypycha zmiany bezpośrednio do domyślnej gałęzi na wyraźną prośbę, bez gałęzi roboczej i pull requestu.
  • 95dev_gate_merge-to-main
    Egzekwuje workflow gałęzi funkcji: przechwytuje próby merge, push lub commitu wprost do main i kieruje na właściwy proces z gałęzią funkcji.
  • 100update-from-upstream-main
    Aktualizuje bieżącą gałąź Remotion najnowszym kanonicznym mainem: scala main do gałęzi funkcji lub PR bez przepisywania opublikowanej historii.

Uwagi i zgłoszenia

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