git pull updates multiple copies of a file

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

git pull updates multiple copies of a file Thu Aug 03, 2023 11:00 pm • by jhkoning
hey there,
i'm looking for a way to update multiple copies of a file (stored in different folders) when a master file is updated via a git pull request.
let's say its example.txt (in the cloned git repo) which is the master file.
the copies of example.txt sit in various other folders /user/one, /user/two etc.
so i'm guessing i monitor the cloned git folder where the example.txt master file is, then i'd have a rule to update the copies of that master file - in those different folders.
does that sound logical & doable?
any pointers or advice?
thanks heaps,
Jason
jhkoning
 
Posts: 8
Joined: Wed Sep 01, 2021 8:35 pm

Sounds doable. You could filter of off date last modified and do a sync or copy of the file. Give it a shot and report back if you run into any problems.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

appreciate the response, i'll report back once i have working solution - in case it's of any help to someone else.

ok, actually pretty easy, but i'm a little stuck on the following.

setting up a rule to copy the source txt file is easy, date last modified & full name is are the rules i'm using.
it successfully copies (& replaces the existing copy of that file) in destination folder 1, but then the rule copies that file from destination folder 1 -> destination folder 2 (& on & on until its done them all).
this obviously works, & the latest version of the source file ends up in each of the destination folders - but it doesn't seem like the most elegant solution.

is there a way to copy the source file to multiple locations?

currently there are a bunch of rules that are all the same (except for the destination folder), sitting under do the following to the matched file or folder.

or is this the expected way to go about this?
jhkoning
 
Posts: 8
Joined: Wed Sep 01, 2021 8:35 pm

It shouldn't really matter since they copies are all identical but if you insist of copying from the source each time, use the Sync action.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

thank you @mr_noodle - i'm all sorted
jhkoning
 
Posts: 8
Joined: Wed Sep 01, 2021 8:35 pm


Return to Support