Package: gitsum
gitsumgitsumis a command-line tool that provides a summary of multiple Git repositories.InstallationEnsure you have Python 3.8+ and pip installed. Then runpipinstallgitsumBasic UsageMove to a directory in which there are Git repositories and then rungitsum.This will print out an overview of the status of each repository within the current directory (or its subdirectories). For example:Found 7 Git repositories.
!  deleted                        master        *  local repo
!  modified                       (d02092)      *  local repo
   remote/empty                   (no commits)     local branch
!  remote/not empty/ahead behind  main             >1 <3
!  remote/not empty/staged        feature       *
!  unmerged                       main          *  local repo
!  untracked                      (no commits)  *  local repoThe standard output includes:The flag!if there are local changes or if the current branch is ahead of or behind its upstream branchThe directory path (relative to the current working directory)The current branch (or the current commit hash if the repo is in detached HEAD mode)The flag*if there are local changes (e.g., untracked files, modified files, deleted files)The remote status, which can be:local repoif the repository has no remoteslocal branchif the repository has at least one remote but the current branch has no upstreamThe number of commits ahead and behind the upstream branch (e.g.,>1 <3say that the given repo is 1 commit ahead and 3 commits behind)General UsageGetting HelpRungitsum--helpListing Files Outside Git ReposIn some cases you might want to know if there are files or directories which are not in a Git repository (e.g., to know if you forgot to make a Git repo for any of your local projects).To see a list of files and directories that are not inside a Git repository (in addition to the normal output), rungitsum--outside-filesTo seeonlythese outside files (without the normal output), rungitsum--only-outside-filesFetching BeforehandTo fetch from each remote repository before displaying the repository statuses, rungitsum--fetchNote that this option is currently limited to public repositories. Ifgitsumis unable to fetch (e.g., because the repository is private), then a warning will simply be displayed.Running the TestsBefore running the tests, clone the repository and install the test dependencies usingpip install -r test-requirements.txt. You must also build the project withpython -m buildand then install the package withpip install --find-links=dist gitsum.The tests can be run by issuing the commandpytest(orpython -m unittest, if you prefer). This must be done from the root of the repository.gitsumis verified by a few integration tests which create Git repos and check that the command's output is as expected. To avoid thegitsumrepo itself interfering with the output, the repo is temporarily disabled by renaming the.git/folder to.git.bak/. This might not be possible if your IDE is using the.git/folder. If you get errors, you might need to disable your IDE's Git integration for this project. For example, in VS Code, you can add a file.vscode/settings.jsonin the root of the repo with the following contents:{"git.enabled":false}