44 lines
1.5 KiB
Markdown
44 lines
1.5 KiB
Markdown
# Syncing `master` with `gitea` remote (d-bis/proxmox)
|
|
|
|
If **`git push gitea master`** fails with **non-fast-forward**, local and **gitea.d-bis.org/d-bis/proxmox** have **diverged**.
|
|
|
|
```bash
|
|
cd /path/to/proxmox
|
|
git fetch gitea
|
|
git log --oneline --left-right master...gitea/master | head -40
|
|
```
|
|
|
|
Resolve by either:
|
|
|
|
1. **Merge** (preserves both histories):
|
|
`git pull gitea master --no-rebase`
|
|
fix conflicts, then `git push gitea master` and `git push origin master` as needed.
|
|
|
|
2. **Rebase** (linear history; use only if your team agrees):
|
|
`git pull gitea master --rebase`
|
|
then push both remotes.
|
|
|
|
Do **not** force-push to **gitea** unless you intend to rewrite shared history.
|
|
|
|
CyberSecur-related commits exist on **GitHub `origin`**; **gitea** may lack them until a successful merge and push.
|
|
|
|
## Parity check (e.g. before audit submission)
|
|
|
|
All three should match (same commit hash):
|
|
|
|
```bash
|
|
git fetch origin
|
|
git fetch gitea
|
|
git rev-parse master origin/master gitea/master
|
|
```
|
|
|
|
If local `master` lags but is a **fast-forward** behind (no local-only commits you need to keep), update and align:
|
|
|
|
```bash
|
|
git checkout master
|
|
git pull origin master --ff-only
|
|
# or: git merge --ff-only gitea/master
|
|
```
|
|
|
|
If you have uncommitted changes, **stash** first (`git stash push -u` if untracked files would be overwritten), then pull, then `git stash pop` as needed. After alignment, `git push origin master` and `git push gitea master` should report **up to date** when remotes already share the tip.
|