跳转到内容
彼岸论坛
欢迎抵达彼岸 彼岸花开 此处谁在 -彼岸论坛

[git] Syncthing 同步 git 仓库下的文件有问题,求大佬指教


小天管理

已推荐帖子

如果 Syncthing 同步的文件同时也在 git 仓库下时,会出现这种问题,设备 A 通过 git 上传到 GitHub ,并通过 syncthing 同步到设备 B 。但设备 B 也有相同的 git 仓库,就会出现下面的问题。

krdw@thinkpad:~/blog$ git status
On branch main
Your branch is behind 'origin/main' by 5 commits, and can be fast-forwarded.
  (use "git pull" to update your local branch)

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified:   src/content/blog/build-your-rss-flow.md

Untracked files:
  (use "git add <file>..." to include in what will be committed)
	src/content/blog/building-homeserver-with-laptop-v2.md
	src/content/blog/file-sync-syncthing-tailscale.md

no changes added to commit (use "git add" and/or "git commit -a")

此时 build-your-rss-flow 的修改和 file-sync-syncthing-tailscale 的新增都已经被设备 A 提交修改到 GitHub 上,building-homeserver-with-laptop-v2 的新增两台设备都没有进行提交。

请教一下各位大佬,在设备 B 我该如何操作呢?以保证和设备 A 相同,git 仓库同步为最新,且未提交更改的文件继续保留,因为设备 B 一删设备 A 也同步会被删。

意见的链接
分享到其他网站

加入讨论

您现在可以发表并稍后注册. 如果您是会员,请现在登录来参与讨论.

游客
回复主题...

×   粘贴为富文本.   粘贴为纯文本来代替

  只允许使用75个表情符号.

×   您的链接已自动嵌入.   显示为链接来代替

×   您之前的内容已恢复.   清除编辑器

×   您无法直接粘贴图片.要从网址上传或插入图片.

  • 游客注册

    游客注册

  • 会员

    没有会员可显示

  • 最新的状态更新

    没有最新的状态更新
  • 最近查看

    • 没有会员查看此页面.
×
×
  • 创建新的...