{"id":20114032,"url":"https://github.com/davidb/git-find","last_synced_at":"2025-05-06T12:30:54.563Z","repository":{"id":32423483,"uuid":"133136420","full_name":"davidB/git-find","owner":"davidB","description":"A tool (cli \u0026 lib) to find local git repositories.","archived":false,"fork":false,"pushed_at":"2025-04-07T14:08:16.000Z","size":266,"stargazers_count":7,"open_issues_count":3,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T12:22:08.879Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davidB.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","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":"2018-05-12T10:35:58.000Z","updated_at":"2025-03-26T10:20:04.000Z","dependencies_parsed_at":"2025-01-13T17:28:36.315Z","dependency_job_id":"20d2551c-cf2a-4680-9209-fac205e48332","html_url":"https://github.com/davidB/git-find","commit_stats":{"total_commits":201,"total_committers":6,"mean_commits":33.5,"dds":0.6368159203980099,"last_synced_commit":"b33405cd0415504ab4d84c00b567e2b3540791a2"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidB%2Fgit-find","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidB%2Fgit-find/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidB%2Fgit-find/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidB%2Fgit-find/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidB","download_url":"https://codeload.github.com/davidB/git-find/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252683423,"owners_count":21788037,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-13T18:27:51.835Z","updated_at":"2025-05-06T12:30:54.274Z","avatar_url":"https://github.com/davidB.png","language":"Rust","readme":"# git-find \u003c!-- omit in toc --\u003e\n\n[![crates license](https://img.shields.io/crates/l/git-find.svg)](http://creativecommons.org/publicdomain/zero/1.0/)\n[![crate version](https://img.shields.io/crates/v/git-find.svg)](https://crates.io/crates/git-find)\n\n[![Actions Status](https://github.com/davidB/git-find/workflows/ci-flow/badge.svg)](https://github.com/davidB/git-find/actions)\n[![Documentation](https://docs.rs/git-find/badge.svg)](https://docs.rs/git-find/)\n\n[![crates download](https://img.shields.io/crates/d/git-find.svg)](https://crates.io/crates/git-find)\n![GitHub All Releases](https://img.shields.io/github/downloads/git-find/git-find/total.svg)\n\nA tool (cli \u0026 lib) to find and broadcast commands on local git repositories.\n\n- [Why](#why)\n- [Usage Cli](#usage-cli)\n  - [Template format](#template-format)\n    - [Possibles values](#possibles-values)\n    - [For scripting](#for-scripting)\n    - [Samples](#samples)\n- [Install](#install)\n  - [From cargo](#from-cargo)\n  - [From binaries](#from-binaries)\n  - [From source](#from-source)\n- [Related and similar](#related-and-similar)\n  - [Informations](#informations)\n  - [Actions (broadcast)](#actions-broadcast)\n- [TODO](#todo)\n\n## Why\n\nBecause I need a tool to list and to reorg my local git repositories.\n\n## Usage Cli\n\n```sh\n$\u003e git find -h\ngit-find 0.5.0\ndavidB\nA tool (cli \u0026 lib) to find local git repositories.\n\nUSAGE:\n    git-find [FLAGS] [OPTIONS] [DIR]\n\nFLAGS:\n    -h, --help       Prints help information\n    -V, --version    Prints version information\n    -v, --verbose    Verbose mode (-v, -vv, -vvv, etc.) print on stderr\n\nOPTIONS:\n    -t, --tmpl \u003cformat\u003e    format of the output print on stdout [default: {{with .working_paths}}{{if\n                           .conflicted}}C{{else}} {{end}}{{if .modified}}M{{else}}{{if .added}}M{{else}}{{if\n                           .deleted}}M{{else}}{{if .renamed}}M{{else}} {{end}}{{end}}{{end}}{{end}}{{if\n                           .untracked}}U{{else}} {{end}}{{end}} {{ .path.file_name }}   {{ .path.full }}        {{with\n                           .remotes.origin}} {{ .name }} {{.url_full}} {{end}}]\n\nARGS:\n    \u003cDIR\u003e    root directory of the search [default: .]\n```\n\n- sample output with default template (M : Modification uncommitted, U: Untracked)\n\n  ```sh\n  $\u003e git-find .       \n          sbt-scalabuff   /home/dwayne/src/github.com/sbt/sbt-scalabuff    origin https://github.com/sbt/sbt-scalabuff.git \n  MU     ML      /home/dwayne/src/github.com/samynk/ML    origin https://github.com/samynk/ML.git \n          BlenderSourceTools      /home/dwayne/src/github.com/Artfunkel/BlenderSourceTools         origin git@github.com:Artfunkel/BlenderSourceTools.git \n          three.js        /home/dwayne/src/github.com/mrdoob/three.js      origin git@github.com:mrdoob/three.js.git \n  MU     Yadef   /home/dwayne/src/github.com/zzuegg/Yadef         origin git@github.com:zzuegg/Yadef.git \n  MU     dmonkey /home/dwayne/src/github.com/kwando/dmonkey       origin https://github.com/kwando/dmonkey.git \n  MU     getdown /home/dwayne/src/github.com/threerings/getdown   origin https://github.com/threerings/getdown.git \n          dart-protoc-plugin      /home/dwayne/src/github.com/dart-lang/dart-protoc-plugin         origin git@github.com:dart-lang/dart-protoc-plugin.git \n  M      vdrones /home/dwayne/src/github.com/davidB/vdrones       origin git@github.com:davidB/vdrones.git \n          shader_editor   /home/dwayne/src/github.com/davidB/shader_editor         origin git@github.com:davidB/shader_editor.git \n          scala-maven-plugin      /home/dwayne/src/github.com/davidB/scala-maven-plugin    origin git@github.com:davidB/scala-maven-plugin.git \n          simpleaudio     /home/dwayne/src/github.com/davidB/simpleaudio   origin git@github.com:davidB/simpleaudio.git \n  MU     ld31_p0cm0n     /home/dwayne/src/github.com/davidB/ld31_p0cm0n   origin git@github.com:davidB/ld31_p0cm0n.git \n          livereload-jvm  /home/dwayne/src/github.com/davidB/livereload-jvm        origin git@github.com:davidB/livereload-jvm.git \n          dart-protobuf   /home/dwayne/src/github.com/davidB/dart-protobuf         origin git@github.com:davidB/dart-protobuf.git \n    U     jme3_skel       /home/dwayne/src/github.com/davidB/jme3_skel     origin git@github.com:davidB/jme3_skel.git \n          asset_pack      /home/dwayne/src/github.com/davidB/asset_pack    origin git@github.com:davidB/asset_pack.git \n          git-find        /home/dwayne/src/github.com/davidB/git-find      origin git@github.com:davidB/git-find.git \n          jme3_ext_assettools     /home/dwayne/src/github.com/davidB/jme3_ext_assettools   origin git@github.com:davidB/jme3_ext_assettools.git \n          ...\n  ```\n\n- broadcast `git status` to every repositories\n\n  ```sh\n  git find -t 'cd {{ .path.full }}; echo \"\\n\\n----\\n$PWD\"; git status' | sh\n  ```\n\n- clean git repository (to free space)\n\n  ```sh\n  git find -t 'cd {{ .path.full }} \u0026\u0026 git clean -d -X -f' | sh\n  ```\n\n### Template format\n\nThe template format is a subset of [golang text/template](https://golang.org/pkg/text/template/).\n\n#### Possibles values\n\n*!! Experimental: values could change with future release !!*\n\n- .path\n  - .file_name\n  - .full\n- .remotes\n  - .\u003cname_of_remote\u003e : eg 'origin'\n    - .name\n    - .url_full\n    - .url_host\n    - .url_path\n- .working_paths\n  - .conflicted : list of path\n  - .modified : list of path\n  - .added : list of path\n  - .deleted : list of path\n  - .renamed : list of path\n  - .untracked : list of path\n\n#### For scripting\n\n1. Use explicit template within your script (the default template could change with each release)\n1. If the template is a shell script (the tips could be used with every interpreter: python, ruby, ...), then you can\n\n  ```sh\n  # run it directly\n  git find -t '...' | sh\n\n  # generate a script and run it later (maybe after review)\n  git find -t '...' \u003e myscript.sh\n  sh myscript.sh\n\n  ```\n\n#### Samples\n\n- to list local repository\n\n  ```tmpl\n  {{ .path.file_name }}\\t{{ .path.full }}\n  ```\n\n- to list local repository with origin url\n\n  ```tmpl\n  {{ .path.file_name }}\\t{{ .path.full }}\\t{{with .remotes.origin}} {{ .name }} {{.url_full}} {{.url_host}} {{.url_path}} {{end}}\n  ````\n\n- to create a sh script to \"git fetch\" on every repository\n\n  ```tmpl\n  cd {{ .path.full }}; echo \"\\n\\n---------------------------------------------\\n$PWD\"; git fetch\n  ```\n\n- to create a sh script to move git repository under $HOME/src (same layout as go workspace)\n\n  ```tmpl\n  echo \"\\n\\n---------------------------------------------\\n\"\n  PRJ_SRC=\"{{ .path.full }}\"\n  {{if .remotes.origin}}\n  PRJ_DST=\"$HOME/src/{{ .remotes.origin.url_host }}/{{ .remotes.origin.url_path}}\"\n  {{else}}\n  PRJ_DST=$HOME/src/_local_/{{ .path.file_name}}\n  {{end}}\n  if [ ! -d \"$PRJ_DST\" ] ; then\n    read -p \"move $PRJ_SRC to $PRJ_DST ?\" answer\n    case $answer in\n      [yY]* )\n          mkdir -p $(dirname \"$PRJ_DST\")\n          mv \"$PRJ_SRC\" \"$PRJ_DST\"\n          ;;\n      * ) ;;\n    esac\n  fi\n  ```\n\n- to list repo with some info (the default template of version 0.4.1)\n\n  ```tmpl\n  {{with .working_paths}}{{if .conflicted}}C{{else}} {{end}}{{if .modified}}M{{else}}{{if .added}}M{{else}}{{if .deleted}}M{{else}}{{if .renamed}}M{{else}} {{end}}{{end}}{{end}}{{end}}{{if .untracked}}U{{else}} {{end}}{{end}}\\t{{ .path.file_name }}\\t{{ .path.full }}\\t{{with .remotes.origin}} {{ .name }} {{.url_full}} {{end}}\n  ```\n\n## Install\n\n### From cargo\n\nWith Rust's package manager [cargo](https://github.com/rust-lang/cargo), you can install via:\n\n```sh\ncargo install git-find\n```\n\nNote that rust version *1.26.0* or later is required.\n\n### From binaries\n\n*!! Experimental !!*\n\nThe [release page](https://github.com/davidb/git-find/releases) includes precompiled binaries for Linux, macOS and Windows.\n\n- download archives for your OS\n- unarchive it, and move the executable into the PATH\n\n```sh\ntar -xzvf git-find_0.3.2-x86_64-unknown-linux-gnu.tar.gz\nchmod a+x git-find\nmv git-find $HOME/bin\nrm git-find_0.2.2-linux.tar.gz\n```\n\n### From source\n\n```sh\ngit clone https://github.com/davidB/git-find\n\n# Build\ncd git-find\ncargo build\n\n# Run unit tests and integration tests\ncargo test\n\n# Install\ncargo install\n```\n\n## Related and similar\n\nSome tools to help management of multi repository\nBut not the same features, else no need to re-do.\n\n### Informations\n\n- [peap/git-global: Keep track of all your git repositories.](https://github.com/peap/git-global) (I quickly look at the source to estimate my contribution to add features, but the \"potentials\" changes are too many and could change the goal usage of the tool)\n- [totten/git-scan: CLI tool for scanning/updating git repos](https://github.com/totten/git-scan/)\n- [fboender/multi-git-status: Show uncommitted, untracked and unpushed changes for multiple Git repos](https://github.com/fboender/multi-git-status)\n\n### Actions (broadcast)\n\n- [gr - A tool for managing multiple git repositories](http://mixu.net/gr/)\n- [mu-repo](http://fabioz.github.io/mu-repo/), Tool to help working with multiple git repositories (short for Multiple Repositories).\n- [mr](http://myrepos.branchable.com/) which is a tool to manage all your version control repositories.\n- [Repo command reference  |  Android Open Source Project](https://source.android.com/setup/develop/repo)\n- [jiri - Git at Google](https://fuchsia.googlesource.com/jiri/)\n- [mateodelnorte/meta](https://github.com/mateodelnorte/meta) tool for turning many repos into a meta repo. why choose many repos or a monolithic repo, when you can have both with a meta repo?\n- [nosarthur/gita: Manage multiple git repos side by side for sanity](https://github.com/nosarthur/gita)\n\n## TODO\n\n- find a rust template engine that support calling method (getter) on current field (or contribute to gtmpl as it's a feature of go template)\n- internally use stream / queue instead of Vector\n- build linux binary with musl (see [rust-musl-builder](https://github.com/emk/rust-musl-builder))\n- optimize\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidb%2Fgit-find","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidb%2Fgit-find","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidb%2Fgit-find/lists"}