Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to backup uncommitted Git repo changes

Tags:

git

backup

For starters, I have looked into both How to backup a local Git repository? && Fully backup a 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. 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.

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.

My solution to the carbonite issue is to not backup the Git repo, but if my machine fails, then I lose my uncommitted code. Anyone have an idea on what I should do here to backup my uncommitted code?

like image 968
Cody Brown Avatar asked Jun 30 '16 20:06

Cody Brown


People also ask

Does git pull remove uncommitted changes?

What happens to my Uncommitted changes? “Uncommited” or even “staged” changes will be lost when you run the “reset” command! If you want to keep those you can use the “stash” command before running the reset, and after doing the “pull”, you can “apply” or “pop” the stashed changes on top of your changes.

How do you get uncommitted changes from one branch to another?

Using the git checkout Command The git checkout -b <BranchName> command will create a new branch and switch to it. Moreover, this command will leave the current branch as it is and bring all uncommitted changes to the new branch.

Where uncommitted changes are temporarily held after adding in git?

git stash: a Clipboard for Your Changes You shouldn't just commit them, of course, because it's unfinished work. Your working copy is now clean: all uncommitted local changes have been saved on this kind of "clipboard" that Git's Stash represents.


1 Answers

Not sure would this help your case but created a tool to backup uncommitted files to a directory.

enter image description here

Also, can be used with a schedule task service.

Git-Uncommited-Files-Backup-Tool-Windows

  • Based on your requirements I do get some ideas to tweak the app 🤔
like image 54
Shazni Shiraz Avatar answered Sep 29 '22 12:09

Shazni Shiraz