How does atom refresh git state when some external editor changes it?

Hi folks,

When I make any changes to a file tracked by git, Atom notices that change and updates the diff in the git GUI on the right side, and also updates the list of files changed.

How does Atom know those files changed, even when done from another editor? I want to add a similar feature to git-gui and I’d like to hear how you folks manage it, and what problems, if any, your approach has.

Do you use something like inotify to watch all files tracked by git? Do you just do a refresh every time Atom comes into focus? Or is it something else?

Pratyush Yadav

You can use Node’s fs module to watch the files, and then run git status when you need to update the status of the files.