跳转到内容
View in the app

A better way to browse. Learn more.

彼岸论坛

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
欢迎抵达彼岸 彼岸花开 此处谁在 -彼岸论坛

[git] git fetch 能否用来备份仓库?

发表于

备份仓库有什么好方法?

起初,我用 git bundle 来备份仓库,但是空间消耗太快,我想尽可能节省空间。

后来发现,Gitea 有「镜像仓库」功能。

上游仓库尚在,本地仓库可以同步更新,上游仓库删除,本地仓库也不会随之消失,本地仓库占用的空间永远与上游仓库相近。

不过这项功能有个缺点,仓库作者可以通过强制推送来删除上游仓库的内容,甚至把仓库换成另一个仓库。若上游仓库换成了另一个仓库,本地仓库也会同步上游仓库更改,变成另一个仓库。

无意间发现了 git fetch

执行 git fetch <repo> *:refs/remotes/0924,待命令执行完毕,refs/remotes/0924 下会完整显示上游仓库引用的一切,git checkout 命令也可调出远程仓库的文件。不知道这么做有没有缺点,请大家指点指点

Featured Replies

No posts to show

创建帐户或登录来提出意见

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.