How to 'Watch' only a directory in a GitHub repository?
Asked Answered
E

6

73

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.

Ethbun answered 16/3, 2012 at 6:14 Comment(2)
See also Github file change notificationPlauen
sourcegraph.com/code-monitoring is another optionOnionskin
E
96

GitHub provides feeds that can do this for both directories and files.1 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:

Directory File
Source on GitHub /Documentation /Documentation/Makefile
History on GitHub /Documentation /Documentation/Makefile
History Atom feed /Documentation /Documentation/Makefile

1 Thank you, youfu.

Edi answered 14/8, 2014 at 18:48 Comment(3)
For private repository according to #7354038 you need to add parameter token=your-tokenProbe
Note that for some files, you just get a cute little "Sorry, this feed is taking too long to generate."Lavonda
It worth mention that the .atom trick also works for a single file.Hymnody
B
13

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.

Blest answered 1/7, 2014 at 19:14 Comment(0)
S
10

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.

Spinoff answered 16/3, 2012 at 6:47 Comment(2)
Would that be lots of code? If not, can you kindly, put the how-to in your answer?Ethbun
@badlearner: I would implement it as a post-receive hook along the lines of "Git: Which commit has this blob?"Spinoff
S
3

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.

Subterfuge answered 30/10, 2015 at 6:32 Comment(1)
yup, works as expected, just make sure to mark "skip numbers" to don't get notify whenever someone forks o gives a star, regards!Subterfuge
M
3

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.

Multifoil answered 9/3, 2020 at 13:20 Comment(2)
Thanks, I have tried it for a couple of days and it works well!Pisistratus
doesn't work, claims it can't find the dotnet/csharplang repository after giving a successful message..Zoroastrian
M
1

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

Milkmaid answered 16/11, 2021 at 17:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.