Jump to content
彼岸论坛
欢迎抵达彼岸 彼岸花开 此处谁在 -彼岸论坛

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


Recommended Posts

Posted

如果 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 也同步会被删。

  • 游客注册

    游客注册

  • Members

  • Recent Status Updates

    No Recent Status Updates
  • Recently Browsing

    • No registered users viewing this page.
×
×
  • Create New...