Created
March 8, 2014 03:20
-
-
Save nicholsonjf/9424846 to your computer and use it in GitHub Desktop.
Add a remote mirror on a network drive from a local Git repository (Windows)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This stackoverflow question was a huge help: http://stackoverflow.com/questions/1887364/git-clone-to-external-drive-for-backup | |
If you use Git on you development machine, it's good to keep a remote backup in case your dev machine fails. | |
Step 1: Create the empty bare repo on your network drive | |
$ mkdir O:/myrepo_backup | |
$ cd O:/myrepo_backup | |
$ git init --bare | |
Step 2: Add a remote to the repo you want to mirror | |
$ cd C:/myrepo | |
$ git remote add --mirror=push backup O:/myrepo_backup | |
Step 3: Push local repo to remote repo on network drive | |
$ cd C:/myrepo | |
$ git push remote | |
Now you should have a remote mirror of you local repo! | |
Every time you want to push changes to your mirror, just repeat Step 3. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment