Skip to content

Instantly share code, notes, and snippets.

@koyudoon
Last active August 29, 2015 14:04
Show Gist options
  • Save koyudoon/f22c8d92ea32fba104e8 to your computer and use it in GitHub Desktop.
Save koyudoon/f22c8d92ea32fba104e8 to your computer and use it in GitHub Desktop.
今まで適当に git clone していたのを ghq で管理するために、対象プロジェクトを点呼する。
find $HOME -name '.git' -print0 | while read -r -d '' f; do
() {
cd ${f%/*}
local remote="$(git remote)"
[ -z "$remote" ] && continue
pwd
git remote -v
echo
}
done
@koyudoon
Copy link
Author

  1. ホームディレクトリ下において
  2. git による監視下にあり
  3. リモートリポジトリが設定されている

ディレクトリ名とそのリモートリポジトリを列挙。

ex.

/home/koyudoon/projects/Ricty
origin  git://github.com/yascentur/Ricty.git (fetch)
origin  git://github.com/yascentur/Ricty.git (push)

/home/koyudoon/projects/libimobiledevice
origin  https://github.com/libimobiledevice/libimobiledevice.git (fetch)
origin  https://github.com/libimobiledevice/libimobiledevice.git (push)

...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment