简体   繁体   English

如何备份未提交的 Git 存储库更改

[英]How to backup uncommitted Git repo changes

For starters, I have looked into both How to backup a local Git repository?首先,我已经研究了如何备份本地 Git 存储库? && Fully backup a git repo? && 完全备份一个 git repo? but my issue lies with backing up things that I have not yet committed to the local repo.但我的问题在于备份我尚未承诺到本地回购的东西。

Specifically, I use carbonite (a backup cloud service) and anytime a file in my selected directories changes, it is backed up to the cloud service.具体来说,我使用 carbonite(一种备份云服务),只要我选择的目录中的文件发生变化,它就会备份到云服务。 This is handy for me with subversion, because if something was to happen that corrupted my local computer, I have all of my saved code backed up.这对我使用 subversion 很方便,因为如果发生损坏我本地计算机的事情,我会备份所有保存的代码。

Now that I have switched to using Git and all of my files change every time I switch branches, Carbonite recognizes it as one directory, and changes all of the backup files every time I switch.现在我已经切换到使用 Git 并且每次切换分支时我的所有文件都会更改,Carbonite 将其识别为一个目录,并且每次切换时都会更改所有备份文件。

My solution to the carbonite issue is to not backup the Git repo, but if my machine fails, then I lose my uncommitted code.我对 carbonite 问题的解决方案是不备份 Git 存储库,但是如果我的机器出现故障,那么我将丢失未提交的代码。 Anyone have an idea on what I should do here to backup my uncommitted code?任何人都知道我应该在这里做什么来备份我未提交的代码?

Not sure would this help your case but created a tool to backup uncommitted files to a directory.不确定这对您的情况是否有帮助,但创建了一个工具来将未提交的文件备份到目录。

在此处输入图片说明

Also, can be used with a schedule task service.此外,还可以与计划任务服务一起使用。

Git-Uncommited-Files-Backup-Tool-Windows Git-Uncommited-Files-Backup-Tool-Windows

  • Based on your requirements I do get some ideas to tweak the app 🤔根据您的要求,我确实得到了一些调整应用程序的想法🤔

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM