备份本地修改的和新的源文件

发布于 2024-08-27 23:55:15 字数 306 浏览 7 评论 0原文

我想知道其他程序员如何备份尚未受源代码控制的更改,无论是新文件还是修改后的文件。我主要指的是中等规模的工作——几乎不值得花费精力建立一个私人分支机构,但需要一天多的时间才能完成。

这不是特定于供应商的问题 - 我想看看不同的产品是否对问题有不同的解决方案。不过,我希望得到有关 SVN 和分布式 SCC 的答案。我主要想知道后者(Mercurial、GIT 等)——您拥有自己的本地存储库真是太好了,但是您是否定期将其与源文件一起备份?

注意 - 我不是在询问一般备份策略。为此,我们有 IT。我正在寻找最好的方法来在将本地修改的内容签回到主存储库之前对其进行备份。

I'm wondering how other programmers are backing up changes that are not under source control yet, be it new files or modified ones. I'm mostly referring to medium size jobs - hardly worth the effort of making a private branch, but taking more than a day to complete.

This is not a vendor-specific question - I'd like to see if various products have different solutions to the problem. I'd appreciate answers referring to SVN and distributed SCCs, though. I'm mostly wondering about that latters (Mercurial, GIT etc.) - it's great that you have your own local repo, but do you back it up on a regular basis along with your source files?

Note - I'm not asking about a general backup strategy. For that, we have IT. I'm seeking the best way to keep locally modified stuff backed-up before they are checked back into the main repo.

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

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

发布评论

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

评论(5

著墨染雨君画夕 2024-09-03 23:55:16

当你说:

几乎不值得付出努力
私人分支机构,但采取了以上
完成日期

我会说你错了。即使只需要一个小时左右才能完成,我也会将其置于版本控制之下。

When you say:

hardly worth the effort of making a
private branch, but taking more than a
day to complete

I would say you are wrong. Even if it only took an hour or so to complete, I would put it under version control.

迎风吟唱 2024-09-03 23:55:16

工作:
我在我的机器上本地使用 Git,并在完成后提交到我们的 Vault 存储库。
我得到了快速分支和合并,构建机器等都得到了工作代码:)

首页:
我在本地使用 Git,完成后推送到网络上的另一个 Git 存储库。

Work:
I use Git locally on my machine and the commit to our Vault repo when i am done.
I get fast branching and merging, Build Machine et all get working code :)

Home:
I use Git locally, and push to another Git repo on my network when i am done.

手心的温暖 2024-09-03 23:55:16

如果我可能需要回到这一点,我会将超过几个小时的文件放入 VCS 中进行“备份”。如果它有任何价值(足以保证备份的想法),那么它会直接进入 VCS。只有当它不够重要时,才会将其排除在 VCS 之外。当然,我会尽力确保 VCS 本身得到备份。

I 'back up' files that are more than, say, a couple of hours old by putting them into the VCS - if I might need to get back to this point. If it is of any value (sufficient to warrant thoughts of backup) then it goes straight into the VCS. Only if it is not important enough to matter does it remain out of the VCS. And I try to ensure that the VCS is itself backed up, of course.

杀手六號 2024-09-03 23:55:16

我在家里使用 Mercurial。该存储库是在我的两台工作计算机上克隆和维护的。最后,我在外部硬盘驱动器上保存了一组 hg 存档文件,这些文件是由我编写的 Python 脚本自动创建的。该存档基于保存在“家庭”计算机上的一组存储库。

我在这里并没有做任何突破性的事情,但是多个硬盘同时损坏的可能性不大。此外,它几乎是自动的,因为我定期在两台计算机之间切换。

如果我有一大段代码需要更改,我将在分支克隆中进行连续的小提交,然后在完成后推回。我更喜欢将我的更改分成小的、受控的组。该分支本质上会得到备份,因为上述脚本会识别所有 hg 存储库并备份它们。简而言之,如果它们存在,就会得到备份。

I use Mercurial for home. The repository is cloned and maintained on my two work computers. Finally, I keep a set of hg archive files on an external hard drive which is created automatically by a Python script that I wrote. The archive is based on a set of repositories kept on the "home" machine.

I'm not doing anything ground breaking here, but the chances of multiple hard drives breaking at once are not likely. Further more, it's almost automatic because I switch between my two computer periodically.

If I have a large segment of code to change, I'll make continuous small commits in a branch clone and then push back when I'm done. I prefer to have my changes segmented in small, controlled groups. The branch would inherently get backed up because the aforementioned script identifies all hg repositories and backs them all up. In short, if they exist, they are backed up.

待天淡蓝洁白时 2024-09-03 23:55:16

一些 SCC(如 Vault)提供搁架。

您可以在存储库中发布变更集而无需提交它。

Some SCC (like Vault) provides shelving.

You can publish a changeset in the repository without commiting it.

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