4

I want to recursively look through directories finding any git repositories with local modifications not synced with the remote. Meaning if I type git status there are no files untracked, deleted, renamed, or modified.

How can this be done?

Back story: I have a project with several libraries in their own respective repositories. Sometimes I edit these libraries and want to push the changes to their original repo, but I lose track of which libraries I modified and want to find them at the end of a day.

Aage Torleif
  • 1,907
  • 1
  • 20
  • 37

1 Answers1

0

You need a script similar to "How to quickly find all git repos under a directory" in order to find those git repo.
(a pure shell search like find . -name .git -type d -prune solution can be more costly than the script referenced here)

That script, for each repo found, will then do a git status, and if needed a git add/commit and push.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250