How to 'Watch' only a directory in a GitHub repository?
GitGithubDirectoryRepositoryGit Problem Overview
For example, https://github.com/vanillaforums/Garden
is the GitHub repository. But I only want to 'watch' this directory https://github.com/vanillaforums/Garden/tree/master/plugins
in the repository.
How do I do that? There doesn't seem to be a way.
Git Solutions
Solution 1 - Git
GitHub provides feeds that can do this for both directories and files. Using that syndication, a service like Blog Trottr can send you an email whenever the feed is updated.
Some samples, taken from the Linux source code on master
:
-
A directory: [source on GitHub][linux-doc], [history on GitHub][linux-doc-hist], [Atom feed][linux-doc-feed].
-
A file: [source on GitHub][linux-make], [history on GitHub][linux-make-hist], [Atom feed][linux-make-feed].
[linux-doc]: https://github.com/torvalds/linux/tree/master/Documentation "Linux documentation on GitHub" [linux-doc-hist]: https://github.com/torvalds/linux/commits/master/Documentation "Linux documentation history on GitHub" [linux-doc-feed]: https://github.com/torvalds/linux/commits/master/Documentation.atom "Linux documentation Atom feed" [linux-make]: https://github.com/torvalds/linux/tree/master/Documentation/Makefile "Linux Makefile on GitHub" [linux-make-hist]: https://github.com/torvalds/linux/commits/master/Documentation/Makefile "Linux Makefile history on GitHub" [linux-make-feed]: https://github.com/torvalds/linux/commits/master/Documentation/Makefile.atom "Linux Makefile Atom feed"
Solution 2 - Git
I can't think of anything if you really need to watch a directory. But if you can get away with a single file, you can use a change tracker like VisualPing1 on the raw view of the file in question. The directory view would probably change every time someone starred or watched the project, but a single file should be sufficient for a lot of people (especially with Makefile.am
/ CMakeLists.txt
/ etc. which list all subdirectories).
1 No particular endorsement. They bought the service I was using before.
Solution 3 - Git
I confirm that the "watch" feature on GitHub is at the repository level, not at the directory level.
For directory-level watching, you could implement it by, for instance, having a local process cloning, then pulling, that repo every x hours, checking the ls-tree
of each new commit, and then sending you an email if an update in plugins
is detected.
Solution 4 - Git
I just found out this service: https://app.github-file-watcher.com/
> Watching a repository on GitHub tells you about social activity (e.g. PRs, issues, etc.), but it doesn't let you know about file-level changes you might care about (e.g. changes to an internal API you're abusing, to a SQL structure, to a dependencies file). > > GitHub File Watcher fills that gap. Just enter your email, the GitHub repository you want to track, and what files you want notifications for. When they change, you get an email.
I don't know yet if it works, will start using now.
Solution 5 - Git
You could follow the commit page with some website that tracks changes on sites. For example I'm using Follow That Page for the history of a file on ActiveAdmin's github.
Solution 6 - Git
I'll post an alternative that involves a combo of GitHub plus email filters:
- Setup emails for all PRs
- Use a filter to do something with all those emails (for myself, I route them to "Social" in Gmail. You could just delete them, whatever)
- Do ANOTHER filter (that wins out over the above one) looking for paths that interest you (Since every PR email has every changed file, you can look for folder paths), and route those emails somewhere else (maybe Primary (in Gmail))
Example:
M Dockerfile.nordic (2)
M firmware-nordic-nrf5x/README.md (2)
M jobs-container/firmware-nordic/build-nrf9160-dk.sh (2)
Maybe I want to see all changes to firmware-nordic-nrf5x/, so I'll filter on that