Git 与 Dropbox 问题

发布于 2024-12-29 19:04:25 字数 142 浏览 0 评论 0原文

关于 Git 和 Dropbox 的问题。我使用各种在线教程设置了 Git 和 Dropbox。当我推送项目时,我注意到 dropbox 文件夹非常小(1mb,而我的本地计算机上约为 4mb)。我很确定实际的文件没有被推送到保管箱。这是正常的吗?

谢谢!

Question about Git and Dropbox. I set up Git and Dropbox using the various tutorials online. When I push up my project, I notice that the dropbox folder is very small (1mb vs about 4 on my local machine). I'm pretty sure that the actual files aren't being pushed up to dropbox. Is this normal?

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

呆萌少年 2025-01-05 19:04:25

正如已经指出的那样,Dropbox 并不是共享存储库的最安全解决方案(请参阅“这很愚蠢吗:通过 DropBox 进行 GIT 共享?

Greg "。 Bacon 表示 Dropbox 已经保留了旧版本的文件,这与 Git 已经做的事情有点多余。

请参阅“此讨论”(这是关于完整的存储库)备份,但不仅仅是一个裸仓库):

众所周知,Dropbox 在同步大量文件时会变得很慢,而 Git 根据设计会在硬盘上创建大量文件。不过,您可以通过定期运行 git gc 来鼓励将大量松散对象打包为少量打包对象。

此外,只要您执行任何基本操作,Dropbox 就会开始同步内容:checkoutstashcommitfetch、rebasereset 等。我担心如果我工作得太快,Dropbox 会启动创建我的文件的冲突副本

更糟糕的是,Git 的内部存储更加脆弱(Git 绝不是一种备份方法!),而且由于 Dropbox 是为处理普通的 .doc 文件而设计的,所以在处理时就太粗心了。它涉及到操作文件或文件名。如果其中的某些内容失败,您可能会发现自己不走运。

将 dropbox 与 git 包< /a>:仅同步一个文件。
这样问题就少得多(但这也意味着像钩子这样的本地设置不是我的捆绑包的一部分)。

As it was already pointed out, Dropbox isn't the safest solution to share your repo (see "Is this plain stupid: GIT Sharing Via DropBox?".

Greg Bacon remarked that Dropbox already retains old versions of files, which is a bit redundant with what Git already does.

See "this discussion" (which was about a full repo backup, not just a bare repo though):

Well, Dropbox is known for becoming slow when syncing lots of files and Git, by design, creates lots of files on your harddrive. You can encourage packing those many loose objects into few packed objects by running git gc on a regular basis though.

Also Dropbox will start syncing stuff as soon as you do basically anything: checkout, stash, commit, fetch, rebase, reset etc. I'd fear that if I was working too fast, Dropbox would start creating conflicted copies of my files.

Even worse, Git's internal storage is even more fragile (Git is by no means a backup method!) and because Dropbox was designed to handle your average .doc files, it is just too careless when it comes to manipulating files or filenames. If something in there fails, you might see yourself out of luck.

I use dropbox with a git bundle: only one file to synchronize.
Much less issues that way (but that also means that local setups like hooks aren't part of my bundle).

锦上情书 2025-01-05 19:04:25

您可以考虑告诉 dropbox 忽略存储库中的 .git 目录。我使用 dropbox 来保存文件的副本(以防我用 git 做了一些愚蠢的事情并取消我的更改),但我不需要 dropbox 来保存 .git 目录的副本。

在保管箱首选项中,“高级”下有一个名为“选择性同步”的部分,可让您禁用特定文件夹的同步。

you might consider telling dropbox to ignore the .git directories in your repo. i use dropbox to keep copies of my files (in case i do something dumb with git and nuke my changes), but i don't need dropbox to keep a copy of the .git directories.

in dropbox prefs, under advanced there's a section called "selective sync" that allows you to disable syncing of specific folders.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文