git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: New to Git / Questions about single user / multiple projects

From
Jakub Narebski <jnareb@gmail.com>
Date
Aug 19, 2009, 12:18 UTC
Message-ID
<200908191418.08838.jnareb@gmail.com>
In-Reply-To
<a2db4dd50908190400x1cbb1506sa38c60e31587f49d@mail.gmail.com>

Please do not toppost, and when responding cull the quoted part, so only those parts that are relevant to your reply are remaining.

On Wed, 19 Aug 2009, Rob wrote:
Show 7 quoted lines
> Thanks all for all the answers :)
> 
> One last question based on the multiple projects issue:
> Is there a command that lists all your projects ?
> 
> My initial thought is that there probably isn't, as there is no
> relation between the project except the userID ?

No, there no git commands for listing all your projects. BTW. you can use different identities for different projects by setting it in .git/config, i.e. in per-repository configuration file.

Simple solution, which finds only non-bare repositories, and which can find false positives:

 $ find ~ -name ".git" -type d -print

More complicated solution, used by gitweb, requires Perl, not checked that it works correctly, doesn't work with ancient repositories with symlink HEAD.

 $ perl -e '
 use File::Find qw(find);
 my @list = ();
 find({follow_fast => 1, follow_skip => 2, dangling_symlinks => 0,
       wanted => sub {
         return if (m!^[/.]$!);
         return unless (-d $_);
         push @list, $_ if -e "$_/HEAD" 
       }});
 print join("\n", @list)."\n";
 '
-- 
Jakub Narebski
Poland
Previous: Rob (gmail)Next: Rob (gmail)
Message 7 of 11 in “New to Git / Questions about single user / multiple projects”
  1. Rob (gmail)Aug 19, 2009
  2. Changsheng JiangAug 19, 2009
  3. Chris PackhamAug 19, 2009
  4. Daniel BarkalowAug 19, 2009
  5. Jakub NarebskiAug 19, 2009
  6. Rob (gmail)Aug 19, 2009
  7. Jakub NarebskiAug 19, 2009
  8. Rob (gmail)Aug 19, 2009
  9. Jeff KingAug 19, 2009
  10. Jeff KingAug 19, 2009
  11. Jakub NarebskiAug 19, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.