You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Wiki-Management.md
+81Lines changed: 81 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -123,6 +123,41 @@ git subtree push --prefix=docs wiki master
123
123
- Pushes them to the GitHub wiki repository
124
124
- Updates the online wiki at `https://github.com/DevKor-github/OnTime-front/wiki`
125
125
126
+
### Force push to GitHub Wiki (use with extreme caution)
127
+
128
+
Sometimes the wiki remote can get out of sync (e.g., someone edited pages directly on GitHub and you want to **overwrite** the wiki with your local `docs/` state). In that case, you _can_ force push — but note:
129
+
130
+
-**This rewrites the wiki repo history** and can discard other people's edits.
131
+
- Only do this if the team agrees and you’re sure your local `docs/` is the desired source of truth.
132
+
- Consider pulling first (`git subtree pull --prefix=docs wiki master --squash`) to avoid needing force.
133
+
134
+
`git subtree push` doesn’t accept `--force`, so you force-push by splitting and pushing the split commit:
135
+
136
+
```bash
137
+
# 0) Make sure your docs changes are committed
138
+
git status
139
+
140
+
# 1) Create a split commit containing only docs/ history
- You want to sync external wiki changes to your local repository
139
174
- Before starting major documentation work (to avoid conflicts)
140
175
176
+
### Troubleshooting subtree sync
177
+
178
+
**Issue: `fatal: working tree has modifications. Cannot add.`**
179
+
180
+
`git subtree pull` requires a clean working tree.
181
+
182
+
```bash
183
+
git status
184
+
# then either commit or stash
185
+
git add docs/
186
+
git commit -m "docs: WIP before subtree pull"
187
+
# or
188
+
git stash -u
189
+
```
190
+
191
+
**Issue: `fatal: refusing to merge unrelated histories`**
192
+
193
+
This happens when your local `docs/` history and the GitHub wiki repository don’t share a common subtree “join” history (often because `docs/` wasn’t originally introduced via `git subtree add`, or the wiki was rewritten independently).
194
+
195
+
Pick one of these paths:
196
+
197
+
1.**Overwrite wiki with local `docs/`** (recommended if `docs/` is the source of truth):
0 commit comments