To setup a repository like D:\gitrepo
, you use what are called remotes. You would use this directory as a remote that you and other developers can use as the "Central SVN-like server". Create the gitrepo
directory, and run the command git init --bare
. Then from your local git repo you can do git remote add origin D:\gitrepo
. Then you push via git push origin master
. Now anyone can clone from D:\gitrepo
and push their changes back up.
I'm not sure what you mean by "(all it takes is deleting one folder and everything is gone)".
If you delete your src/
folder, your data isn't gone. You can easily roll it back with git reset --hard HEAD
assuming you didn't commit it. If you did commit it use git revert SOMESHA
. Obviously SOMESHA
is the SHA1 hash for the commit. If you accidentally delete D:\gitrepo
, that's not a problem because your working copy is exactly the same. Just do what I said in the first paragraph again. The only way to lose everything is if you delete the remote repository and all of the repositories cloned from it.
For backups, you just need to backup the entire D:\gitrepo
folder.
For your second point, there is no easy way to have branches in separate directories. The best you can do is to have two clones, and set each clone to a different branch. I'm not familiar with Beyond Compare, but git diff
works between two branches without require separate directories. Just use git diff master somebranch
. To see which branches you have, use git branch