How to mock committing a post to github, for a repo that doesn't belong

Id to enable post commit to repository which I don't have. Is this possible with forking + tracking? Or is there some other way to enable viewing commits of another repository so that your own repository can enable custom hooks after commit?

For context: In this case - I am an active developer on a project that I do not have admin rights, which is open source and on github, so I would like to have some post-commit custom hooks for me without forcing the admin to install them.

I guess git tracking is the idiomatic way of doing this, but I'm not sure how github works when it comes to cascading commit down events.

+3


source to share


1 answer


For what you want to do, you can add another remote repository to your local working directory: 1 ° link your working directory to the official repo (this way you will have both the original and the official as a remote repository) $ git remote add the official git @ github.com: official / repo 2 ° update your local master branch (or whatever) $ git fetch official && git merge official / master --ff 3 ° push changes to your github account $ git initial master push

You can now automate this (2 °) in a script that can be executed every time you receive mail from github for that particular repo, or it might be easier to create a cron for that (with an optional check to try to merge only if clean directory).



What needs to be automated is only "fetch and merge", maybe you can just do it manually

0


source







All Articles