0

I have a project C:\Work\Project

With .git C:\Work\Project.git

I want keep project in C:\Work\Project

But move .git to D:\Work\Project.git

I try use mklink mklink /d c:\Work\Project.git d:\WORK\Project.git

But SourceTree not work with error 'git status' failed with code 128: fatal: Invalid symlink 'c:\Work\Project.git': Function not implemented

I don`t want multiple folders.

I want keep repositories on other drive from code.

Alexandr Sulimov
  • 1,894
  • 2
  • 24
  • 48
  • Possible duplicate of [Multiple working directories with Git?](http://stackoverflow.com/questions/6270193/multiple-working-directories-with-git) – Panagiotis Kanavos Dec 14 '16 at 12:56
  • 2
    The `.git` folder is the actual code repository. Your project folder is the working directory, ie your current working copy of the files. You are asking how to use a different working directory. The duplicate question shows some possibilities but this is fragile. Why do you want to separate the repo from your working directory? – Panagiotis Kanavos Dec 14 '16 at 12:59
  • @PanagiotisKanavos 1. I want keep .git folder on other drive 2. .git folder contain more 2000 files and i don`t want it on drive with code. 3. symlink is good but not work – Alexandr Sulimov Dec 14 '16 at 13:04
  • But *why*? To save space? A repo with many files (2000 is *not* a lot) doesn't affect the disks performance, as they are mostly read-only (git doesn't alter stored objects, it creates diff objects) – Panagiotis Kanavos Dec 14 '16 at 13:07
  • @PanagiotisKanavos I use SSD. And faced with the fact that the SSD may refuse without notice. I always installed SSD + HDD. SSD - to work, HDD - data – Alexandr Sulimov Dec 14 '16 at 13:13
  • 1
    Then you should be pushing to a "backup" bare repo, not try to separate the repo from the working directory. You can create a hook to push changes to another local repo (second HDD, an external USB drive, a file share, or all of them) and a hosted repo just to be sure. That would give you real security for minimal cost – Panagiotis Kanavos Dec 14 '16 at 13:59
  • Imagine the "kid spilled milk on laptop and pushed it over the table" scenario. Multiple remotes with hooks will save you when separating the working directory can't – Panagiotis Kanavos Dec 14 '16 at 14:00

0 Answers0