This commit is contained in:
parent
0cdaa0a61f
commit
6392120b3a
1 changed files with 6 additions and 7 deletions
|
|
@ -2,7 +2,7 @@ Git Workflow and Branch Protection
|
||||||
==================================
|
==================================
|
||||||
|
|
||||||
Goal
|
Goal
|
||||||
- Keep `master` protected; changes land via pull requests with review and passing checks.
|
- `master` is currently unprotected; contributors can push directly. Prefer feature branches + PRs so changes stay reviewable and CI-visible.
|
||||||
|
|
||||||
Remotes
|
Remotes
|
||||||
- Forgejo repo: `ssh://git@git.halla-aho.net:2223/thalla/lomavuokraus.git`
|
- Forgejo repo: `ssh://git@git.halla-aho.net:2223/thalla/lomavuokraus.git`
|
||||||
|
|
@ -31,7 +31,7 @@ Daily flow
|
||||||
```
|
```
|
||||||
5) Open a PR targeting `master` in Forgejo.
|
5) Open a PR targeting `master` in Forgejo.
|
||||||
6) Get review + approvals; ensure CI passes.
|
6) Get review + approvals; ensure CI passes.
|
||||||
7) Merge via the PR; master stays protected.
|
7) Merge via the PR; direct pushes work but are discouraged.
|
||||||
8) After merge, sync local master:
|
8) After merge, sync local master:
|
||||||
```
|
```
|
||||||
git checkout master
|
git checkout master
|
||||||
|
|
@ -40,11 +40,10 @@ Daily flow
|
||||||
```
|
```
|
||||||
|
|
||||||
Branch protection (set in Forgejo UI)
|
Branch protection (set in Forgejo UI)
|
||||||
- Settings → Branches → Protect `master`.
|
- Currently disabled on `master`. To re-enable:
|
||||||
- Enable:
|
- Settings → Branches → Protect `master`.
|
||||||
- Prevent direct pushes (except admins if desired).
|
- Prevent direct pushes (except admins if desired).
|
||||||
- Require pull requests.
|
- Require pull requests and at least 1 approval.
|
||||||
- Require at least 1 approval.
|
|
||||||
- Restrict who can push (admins/maintainers).
|
- Restrict who can push (admins/maintainers).
|
||||||
- Optionally dismiss stale approvals and require status checks (CI).
|
- Optionally dismiss stale approvals and require status checks (CI).
|
||||||
|
|
||||||
|
|
@ -62,7 +61,7 @@ Recommended local config
|
||||||
Common troubleshooting
|
Common troubleshooting
|
||||||
- Divergent branches on pull: set pull strategy (see above) and rerun `git pull --rebase` or `git pull`.
|
- Divergent branches on pull: set pull strategy (see above) and rerun `git pull --rebase` or `git pull`.
|
||||||
- “Remote not found”: add `origin` remote (see Remotes).
|
- “Remote not found”: add `origin` remote (see Remotes).
|
||||||
- Push rejected (protected branch): push to a feature branch and open a PR.
|
- Push rejected (if protection is re-enabled): push to a feature branch and open a PR.
|
||||||
- Conflicts during pull/rebase:
|
- Conflicts during pull/rebase:
|
||||||
```
|
```
|
||||||
git status # see conflicted files
|
git status # see conflicted files
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue