threads / discuss / 57783

Is it possible to treat symlinks just as normal files in Git?

Subject: Is it possible to treat symlinks just as normal files in Git?

## tl;dr

One message between Apr 22, 2022 and Apr 22, 2022.

replies: 0people: 1as markdown or json

Mikhail Merkuryev· Apr 22, 2022, 23:40 UTC · lore

My task. I have unit.h in both repo1 and repo2. I make a symlink from repo1 to repo2 and want such a behaviour: in both repos I want to treat unit.h like normal file, not symlink.

Why to do this though Git has submodules?
1. One of repos may be unrelated, private, corporate…
2. Auxiliary things like unit testing require additional bookkeeping, 
e.g. moving unit testing framework (Google Test etc) to the submodule, 
special directory setup…
3. The repo becomes harder to pick up if you do not have/want Git. With 
submodules, if you do “download ZIP”, you get uncompileable source. Even 
in Linux where Git is out-of-the-box, you do some command-line magic 
before repo starts to work.
4. Submodules are just a “big gun” for library <30k in size.
5. Developing alone does not involve pulling, but with submodules it 
becomes the case.

Men at Git for Windows thought it’s not just a Windows issue and sent me here.

← back to recent threads