如何迁移旧GitStack安装及本地Git仓库至新电脑?
GitStack Repository Migration Guide
Hey there! I’ve got hands-on experience with GitStack migrations, so let me walk you through exactly how to get your old repositories up and running on the new installation. Here’s a step-by-step breakdown:
Step 1: Match GitStack versions first
- Install the exact same version of GitStack on your new computer as the one you had on the old laptop. You can check the old version by looking at the properties of
GitStack.exein the old drive'sGitStackfolder, or finding version info in config files likesettings.ini. Using the same version avoids weird compatibility glitches. - Finish the basic setup (create an admin account, set up ports if needed) but hold off on creating any new repositories—we’ll bring the old ones over instead.
Step 2: Locate your old repository files
- On your mounted old hard drive, navigate to the default GitStack repositories directory:
[Old Drive Letter]:\Program Files (x86)\GitStack\repositories - Inside this folder, you’ll see all your existing repositories—each is a folder ending with
.git(e.g.,my_project.git). These are the "bare" repositories GitStack uses to host code.
Step 3: Copy repositories to the new installation
- First, stop the GitStack service on your new computer. Open the Windows Services app, find "GitStack", and click "Stop". This prevents file locks while we copy.
- On the new computer, find the new GitStack repositories path (default is
C:\Program Files (x86)\GitStack\repositories). - Copy all the
.gitfolders from the old drive’s repositories directory to the new one. Make sure you copy the entire folder structure—don’t just move individual files inside them.
Step 4: Fix Windows permissions (super important!)
- GitStack needs specific permissions to read/write repositories. For each copied
.gitfolder:- Right-click the folder → Properties → Security tab.
- Click Edit → Add, then type
NETWORK SERVICEand click Check Names to confirm the user exists. - Grant the
NETWORK SERVICEuser Full Control over the folder and all its subfolders/files.
- Repeat this for the parent
repositoriesfolder on the new installation to cover future repositories too.
Step 5: Refresh GitStack and verify
- Start the GitStack service again from the Windows Services app.
- Open the GitStack web interface (default is
http://localhost:8080), log in with your new admin account. - You should see all your old repositories listed immediately. If not, clear your browser cache and refresh, or restart the GitStack service once more.
Step 6: Test functionality
- Clone one of the repositories to a local test folder using:
git clone http://[your-new-computer-ip]:8080/[repo-name].git - Make a small test change, commit it, and push it back to confirm read/write access works perfectly.
Quick Troubleshooting
- Repositories not showing up? Double-check you copied the full
.gitfolders, permissions are set correctly, and the GitStack service is running. - Push/pull permission errors? Ensure
NETWORK SERVICEhas full control, and the GitStack web interface marks the repository as "Writable" for your user. - Version mismatch issues? Uninstall the new GitStack, install the old version from a backup or official archive, then repeat the migration steps.
内容的提问来源于stack exchange,提问作者Syzygy
相关产品推荐
相关产品推荐

