0

I am in the process of migrating from visual source un-safe (VSS) to Git.

One of the good features of VSS is that you can put the same script in different folders, and when you check it out it updates the script in all the folders you have placed it.

if there a way to achieve the same thing using Git? TIA M

Marcello Miorelli
  • 3,368
  • 4
  • 44
  • 67
  • 1
    It's not that straightforward but it's kind of achievable, see [Git Symlinks in Windows](http://stackoverflow.com/q/5917249/537554). – ryenus Oct 13 '14 at 12:52

1 Answers1

3

Git itself has no such mirroring feature for files within a project. I see two possible solutions:

  • If your file system supports symbolic links or something equivalent that would be one way of solving it. I guess reasonably recent versions of Windows support symlinks but I don't know how Git deals with them (probably also depends on whether you run msysgit or cygwin's Git). See Git Symlinks in Windows.
  • You can write a post-checkout hook for Git that copies files after a new commit is checked out. It should be fairly easy.

That said, I consider said VSS feature a gross misfeature that I think you should try to get away from instead of mimic with Git.

If you want to share files between projects you can look into submodules.

See also Why do Version Control Systems lack the sharing functionallity of Visual Source Safe and what source control do you use and reckon is worth trying out?.

Community
  • 1
  • 1
Magnus Bäck
  • 11,381
  • 3
  • 47
  • 59
  • this answer has given me lots of food for thought. I will have to investigate more the submodules thing. I don't recomend VSS to anyone, but the link feature mentioned above is very useful for me. – Marcello Miorelli Oct 13 '14 at 12:49
  • I would really like to know more about the following:You can write a post-checkout hook for Git that copies files after a new commit is checked out. – Marcello Miorelli Oct 13 '14 at 12:52