{"id":38488774,"url":"https://github.com/gerph/ls-with-git-status","last_synced_at":"2026-01-17T05:39:45.653Z","repository":{"id":128876570,"uuid":"181149477","full_name":"gerph/ls-with-git-status","owner":"gerph","description":"lsg: List files with git status information","archived":false,"fork":false,"pushed_at":"2024-08-11T12:35:30.000Z","size":40,"stargazers_count":43,"open_issues_count":0,"forks_count":9,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-11T13:47:55.235Z","etag":null,"topics":["git","ls","unix-command"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gerph.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-13T09:34:21.000Z","updated_at":"2024-08-11T13:47:58.520Z","dependencies_parsed_at":null,"dependency_job_id":"d5acac96-936d-442a-b097-c0ad8fd80f03","html_url":"https://github.com/gerph/ls-with-git-status","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gerph/ls-with-git-status","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gerph%2Fls-with-git-status","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gerph%2Fls-with-git-status/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gerph%2Fls-with-git-status/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gerph%2Fls-with-git-status/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gerph","download_url":"https://codeload.github.com/gerph/ls-with-git-status/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gerph%2Fls-with-git-status/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28500603,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T04:31:57.058Z","status":"ssl_error","status_checked_at":"2026-01-17T04:31:45.816Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["git","ls","unix-command"],"created_at":"2026-01-17T05:39:45.278Z","updated_at":"2026-01-17T05:39:45.642Z","avatar_url":"https://github.com/gerph.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lsg: ls with git information\n\n## Introduction\n\nThe `lsg` tool is intended to give information on files in a directory\nin the same style as the `ls` command - but adding more information about\nthe git status of those files. The idea is to make it possible to see the\ngit status in the same style as the `ls` command.\n\nThe tool is known to work on linux (Ubuntu), and Mac OS (10.12 to 10.14),\nand probably works on other systems\n\n## What it looks like\n\nAn example 'asciicast' can be seen here: https://asciinema.org/a/219091\n\n[![asciicast](https://asciinema.org/a/219091.svg)](https://asciinema.org/a/219091)\n\n## What it can show\n\nFiles within a git repository:\n\n  * File changes are only shown in braces.\n  * Untracked and ignored files are shown:\n      - `{untracked}`                 - File is not known to git\n      - `{ignored}`                   - File is listed as a pattern in .gitignore\n  * Changed files in the working tree are shown:\n      - `{modified locally, 3 lines}` - Changed in working tree, 3 lines affected (added or deleted)\n      - `{deleted locally}`           - File has been deleted in working tree\n  * Changed files in the cache are shown:\n      - `{staged, 3 lines}`           - Changes have been staged, 3 lines affected (added or deleted)\n      - `{deleted}`                   - File has been marked for deletion in cache\n      - `{added}`                     - File has been marked for addition in cache\n      - `{renamed}`                   - File has been renamed to this name in the cache\n  * Merge status is show:\n      - `{unmerged, both added}`      - File was added by merge, and we added it as well.\n\nDirectories within a git repository:\n\n  * Only untracked or ignored state is shown (to make lists faster):\n      - `{untracked}`                 - Directory is not known to git\n      - `{ignored}`                   - Directory is listed as a pattern in .gitignore\n\nRepositories and submodules:\n\n  * Branch details are in brackets:\n      - `(master)`            - directory is at the head of branch master\n  * Relative location compared to upstream is shown with arrows after the name\n      - `(master￪1)`          - 1 commits locally ready to be pushed\n      - `(master￬7)`          - 8 commits available in fetched upstream\n      - `(master⊗)`           - no upstream is configured\n      - `(master~2○)`         - detached head\n  * Submodule reference changes are described within the brackets:\n      - `(master added)`      - Submodule has been added\n      - `(master 8 forward)`  - Submodule has moved 8 changes forward in the same tree (in working tree)\n      - `(master 2 back)`     - Submodule has moved 2 changes backward in the same tree (in working tree)\n      - `(master new ref)`    - Submodule has changed to a ref unrelated to the old tree (in working tree)\n      - `(master staged 1 forward)`   - Submodule has moved 1 changes forward in the same tree (in the cache)\n  * Summary of changes to the files within the submodule are shown in braces:\n      - `{1 modified}`        - 1 file has been changed in the working tree\n      - `{2 staged}`          - 2 files have been changed and staged in the working tree\n  * All the above options can be combined.\n\n\n## Requirements\n  * `bash` - version 3 or 4; although it'll be slower on 3 due to lack of associative arrays\n  * `git` - obviously\n  * `ls`\n      - BSD version supplied with Mac OS or a GNU version\n      - colour is supported (and explicitly forced)\n  * `perl` - version 5 upward (although might be version 3 compatible)\n  * `grep` - BSD version supplied with Mac OS or a GNU version\n  * `sed` - BSD version supplied with Mac OS or a GNU version\n\n\n## How to use it\n\nThe `lsg` command can be used almost exactly like the `ls` command.\nThe actual operation of the command is to invoke `ls` and then post-process\nthe output, so most of the `ls` switches and uses are exactly the same.\nHowever, because it only handles single columns, the switches related to\nmulti-column, comma-separated and dired formats are not usable.\n\nBecause the command expects to use colour, colouring will be forced in the\nls output.\n\nThere is an extra switch that the `lsg` tool adds for showing nested\nsubdirectories. The `--nest` (or `--nest=\u003cdepth\u003e`) switch can be used to\nlist subdirectories as well.\n\n\n## Configuration\n\nColouring for the output is taken from git configuration.\nIf you wish to change the colours used, the following configurations are\nread:\n\n| config name            | usage    | default |\n| ---------------------- | -------- | ------- |\n| color.status.branch    | Branch name | cyan |\n| color.status.added     | Added file | green |\n| color.status.updated   | Staged file | green |\n| color.status.changed   | Modified file | yellow |\n| color.status.untracked | Not known to git | red |\n| color.status.unmerged  | Not yet merged | red bold |\n| color.status.ignored   | Ignored by .gitignore | dim |\n\nTowards the top of the code, there are a number of constant symbols\nassigned which define the symbols used to show some states. Only the\nbranch state and relative position in the git history use symbols;\notherwise words are used to describe the status.\n\nEnvironment variables can be used to control the invocation of the\ntool:\n\n* `LSG_COMMAND`       - The command to call (defaults to `ls`); use `gls` on Mac OS to force the GNU version.\n* `LSG_OPTIONS`       - Default options to supply to the `ls` command, eg `-l` would force the listing to always be long.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgerph%2Fls-with-git-status","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgerph%2Fls-with-git-status","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgerph%2Fls-with-git-status/lists"}