GIT中不同位置的相同文件 [英] Same file in different locations in GIT
问题描述
如何在同一分支的GIT中的不同位置添加相同文件 如果我在一个地方更新,它也应该在另一个地方反映
How to add a same file in different locations in GIT on same branch If i update in one place it should reflect in other place also
这是流程
文件"a.txt"在目录"DIR 1"下 并且我需要目录"DIR 2"下的相同文件
file a.txt under directory "DIR 1" and i need same file under directory "DIR 2 "
如果我在a.txt上提交/更新任何内容,它应该反映两个位置.
If I commit /update anything on a.txt it should reflect two places.
我使用了符号链接,没有任何办法将其删除吗?
I used symbolic links no use is there any way to get it down ?
推荐答案
Symbolic links are one correct way, but on Windows, you need to be careful as how you register them in your Git repo:
有关正确的检出后脚本的信息,请参见" Windows中的Git符号链接",以正确更新/恢复这些符号链接引用的内容.
See "Git Symlinks in Windows", for the right post-checkout script in order to correctly update/restore the content referenced by those symlinks.
这篇关于GIT中不同位置的相同文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!