首先,请确保你已经克隆并本地设置了Quartz。
然后在GitHub.com上创建一个新仓库。不要使用README
、许可证或gitignore
文件初始化新仓库。
在GitHub.com的快速设置页面顶部,点击剪贴板图标复制远程仓库URL。
在你选择的终端中,导航到Quartz文件夹的根目录。然后运行以下命令,将REMOTE-URL
替换为你从上一步复制的URL。
# list all the repositories that are tracked
git remote -v
# if the origin doesn't match your own repository, set your repository as the origin
git remote set-url origin REMOTE-URL
# if you don't have upstream as a remote, add it so updates work
git remote add upstream https://github.com/jackyzha0/quartz.git
然后,您可以将内容同步上传至代码仓库。这是一个辅助命令,可帮助您完成内容的首次推送至仓库操作。
npx quartz sync --no-pull
fatal: --[no-]autostash option is only valid with --rebase
您可能使用的是旧版本的
git
。更新git
应该可以解决此问题。
未来更新时,您只需在需要推送更新到仓库时运行 npx quartz sync
即可。
标志和选项
要查看完整的帮助选项,可以运行
npx quartz sync --help
。以下选项通常都有合理的默认值,但如果您有自定义设置可以覆盖它们:
-d
或--directory
: 内容目录。默认情况下是content
-v
或--verbose
: 打印额外的日志信息--commit
或--no-commit
: 是否对更改进行git
提交--push
或--no-push
: 是否将更新推送到您的 Quartz GitHub 分叉仓库--pull
或--no-pull
: 是否在推送前尝试从您的 Quartz GitHub 分叉仓库拉取更新(例如来自其他设备的更新)