From c35818c336e64e43c54766a670e03cd165b59503 Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Fri, 15 Dec 2023 00:48:09 +0000
Subject: [PATCH] fix: set upstream in sync handler, cleanup docs around setting up github
---
quartz/cli/handlers.js | 2 +-
docs/setting up your GitHub repository.md | 6 +++++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/docs/setting up your GitHub repository.md b/docs/setting up your GitHub repository.md
index 4165517..ca67e85 100644
--- a/docs/setting up your GitHub repository.md
+++ b/docs/setting up your GitHub repository.md
@@ -12,10 +12,14 @@
![[github-quick-setup.png]]
-In your terminal of choice, navigate to the root of your Quartz folder. Then, run the following command, replacing `REMOTE-URL` with the URL you just copied from the previous step.
+In your terminal of choice, navigate to the root of your Quartz folder. Then, run the following commands, replacing `REMOTE-URL` with the URL you just copied from the previous step.
```bash
+# add your repository
git remote add origin REMOTE-URL
+
+# track the main quartz repository for updates
+git remote add upstream https://github.com/jackyzha0/quartz.git
```
To verify that you set the remote URL correctly, run the following command.
diff --git a/quartz/cli/handlers.js b/quartz/cli/handlers.js
index 8fd0912..586881a 100644
--- a/quartz/cli/handlers.js
+++ b/quartz/cli/handlers.js
@@ -528,7 +528,7 @@
await popContentFolder(contentFolder)
if (argv.push) {
console.log("Pushing your changes")
- const res = spawnSync("git", ["push", "-f", ORIGIN_NAME, QUARTZ_SOURCE_BRANCH], {
+ const res = spawnSync("git", ["push", "-uf", ORIGIN_NAME, QUARTZ_SOURCE_BRANCH], {
stdio: "inherit",
})
if (res.status !== 0) {
--
Gitblit v1.10.0