Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Same file in different locations in GIT

Tags:

git

git-add

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

Here is the flow

file a.txt under directory "DIR 1" and i need same file under directory "DIR 2 "

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 ?

like image 978
Scg Avatar asked Jan 01 '26 00:01

Scg


1 Answers

Symbolic links are one correct way, but on Windows, you need to be careful as how you register them in your Git repo:

See "Git Symlinks in Windows", for the right post-checkout script in order to correctly update/restore the content referenced by those symlinks.

like image 50
VonC Avatar answered Jan 04 '26 07:01

VonC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!