Skip to content

Commit 6593479

Browse files
committed
build: subtree init
1 parent 6a35fc8 commit 6593479

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ npm run deploy
6969
```
7070

7171
### Content Syncing
72-
Stories are managed via git subtrees:
72+
Stories are managed via git subtrees. Because subtree remotes are not tracked by git, you must initialize the remote once after cloning:
73+
- `npm run init-stories`: Initialize the stories remote URL (only needed once).
7374
- `npm run pull-stories`: Sync stories from the remote repository.
7475
- `npm run push-stories`: Push local story changes to the remote repository.
7576

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"scripts": {
4040
"generate-rss": "node scripts/generate-rss.js",
4141
"generate-sitemap": "node scripts/generate-sitemap.js",
42+
"init-stories": "git remote add fezcodex-stories https://github.com/fezcode/fezcodex.stories",
4243
"pull-stories": "git subtree pull --prefix public/stories fezcodex-stories main --squash",
4344
"push-stories": "git subtree push --prefix public/stories fezcodex-stories main",
4445
"generate-wallpapers": "node scripts/generateWallpapers.js",

public/posts/fezcodex-stories-with-git-subtrees.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ Before you begin, ensure your working directory is clean. Git commands like `git
3333

3434
First, we'll add the external repository as a remote to your current Git project. This gives it a short, memorable name that you can use to reference it later.
3535

36+
**Important Note for Collaborators:** Since Git does not track remotes in the repository itself, every time you clone this project fresh, you must re-run this step to enable syncing. In this project, we've simplified this with a command: `npm run init-stories`.
37+
3638
**Explanation:** This command tells your local Git repository about the existence of the `fezcodex.stories` repository and associates it with the name `fezcodex-stories`. This makes it easier to fetch from or push to this external repository without typing out the full URL every time.
3739

3840
**Command:**

0 commit comments

Comments
 (0)