help me?
                  
                  
                  basically I have an array of files; if any of those files have changed I want that hook to push those files to another repo.
                  
                  
                  no, I can't put up a mirror, since the two repos have two different codebases but share some files.
                  
                  
                  as of now we manually use a .bat script (guess how legacy this is :P), but I would like git to do that sync on push automatically. is it even achievable? I tried a script that:
                  
                  
                  instantiates the array
                  
                  
                  clones the two repos in $(mkemp -d)
                  
                  
                  for file in $FILES[@];do cp -f temp/repo1 temp/repo2; done
                  
                  
                  cd repo2; git add ./*; git commit -m 'autosync commit done on date +...'; git push
                  
                  
                  but it does not work; it says that repo2 is not a git directory
                  
                  
                  now, this solution is terrible, I know, so feel free to insult me for it, but can someone help me? I'm fairly experienced in bash scripts and git, but I have no idea on how to structure the post-recieve hook..
                  
                  
                
brother, look into submodules and dependabot
Обсуждают сегодня