Skip to content

Instantly share code, notes, and snippets.

@stuartwakefield
Created January 4, 2019 21:03
Show Gist options
  • Save stuartwakefield/8767cd78521265c1dde0ff46e1bb2df5 to your computer and use it in GitHub Desktop.
Save stuartwakefield/8767cd78521265c1dde0ff46e1bb2df5 to your computer and use it in GitHub Desktop.
Some useful bash scripts for cleaning up code workspaces
#!/bin/bash
# Checks the Git status of all subdirectories of the current directory, i.e.,
# whether it has a Git repository, if the working copy is dirty / has uncommitted files,
# the status and tracking of local branches and whether the local repository is connected
# to a remote repository.
find . -maxdepth 1 -type d | xargs -I '{}' bash -c 'echo ----- {} ; git -C {} status ; git -C {} branch -vv ; git -C {} remote -v'
#!/bin/bash
# Gets the content size of all subdirectories of the current directories
find . -maxdepth 1 -type d | xargs du -sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment