0

I use Git Tower to manage my Git repositories on OS X, so I'm looking for an answer which let me use that software or simply the Git cli.

I have some Git (private GitHub) repositories cloned locally, I never work on them but I need them to be always updated because I run the software contained in these repositories (or I use some part of these repositories as dependencies of another repository, no submodule, sorry).

So, I'm looking for a way to keep these repositories always updated. How can I do?

2
  • Sounds like you're creating a build server?
    – Arjan
    Sep 12, 2015 at 14:40
  • No, we have already a CI using jenkins, this is just for my local workflow
    – Fez Vrasta
    Sep 12, 2015 at 14:41

2 Answers 2

0

Git's main purpuse is not distributing your software, but you could always run git pull before reloading your code.

6
  • Yup that'sthe problem, I'd just like to have them always updated without have to remember it.
    – Fez Vrasta
    Sep 12, 2015 at 14:26
  • @FezVrasta do you need to restart your software after the poll? If you do this than you could just write a script. Sep 12, 2015 at 14:28
  • It could work for one of the repositories, but the other one just needs to be updated and nothing more. Or better, it must be updated and then I need to run an additional script to copy these files in another folder (I know it sucks)... So probably I'd need to keep it always updated and run a git hook after the git pull, but the hook is easy to do.
    – Fez Vrasta
    Sep 12, 2015 at 14:31
  • You could always run the update after a special event (depends on your software), if it is a remote, than you could use GitHubs WebHooks as a trigger or as a workaround you could use a Cronjob. Sep 12, 2015 at 14:40
  • I think the cronjob is the only way :/ If there was any git specific way to do so I would have preferred it tho..
    – Fez Vrasta
    Sep 12, 2015 at 14:42
0

It sounds like you may need a combination of tools.

First, you need a way to keep track of the repositories that need updating and update them in one fell swoop. myrepos is a good option for helping with that.

Then you need a way to periodically run the update command, which can be done a variety of ways. There's some good pointers in other comments : cron, a launch agent of sorts, etc.

It strikes me, though, that if the repos are updated automatically in the background (w/o user initiation/intervention), you'd want some report/log/email to be generated when the repos are updated, should anything fail or other unexpected conditions occur.

It also should be noted that blindly updating repos and then copying/packaging the updated code for use elsewhere is somewhat risky. IMHO, this problem smells like it needs a proper dependency management tool or package manager.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .