nosarthur / gita

Manage many git repos with sanity 从容管理多个git库
MIT License
1.67k stars 74 forks source link

Adding groups doesn't work as in readme example #261

Closed TamaMcGlinn closed 1 year ago

TamaMcGlinn commented 1 year ago

The readme has this example:

gita group add repo1 repo2 -n my-group

But when I try this (after creating repo1 and repo2 git repos inside the current working dir), it gives me:

usage: gita group add [-h] -n group-name [-p group-path] repo [repo ...]
gita group add: error: argument repo: invalid choice: 'repo1' (choose from )

I also tried different orders of argument as suggested in the message:

$ gita group add -n my-group repo1 repo2
usage: gita group add [-h] -n group-name [-p group-path] repo [repo ...]
gita group add: error: argument repo: invalid choice: 'repo1' (choose from )

And also the example for auto-adding should work, since repo1 and repo2 are the only two git repos in my current working dir:

$ gita add -a my-group
No new repos found!

So... what can I do to debug? It kinda looks like the whole tool doesn't work for me.

$ gita --version
gita 0.16.6.4
dzhou-schrodinger commented 1 year ago

In order to use group command, the repos has to be added first

Checkbthe add sub command. There are options to recursively add and automatically group when adding repos

TamaMcGlinn commented 1 year ago

~So, the gita add -a command should have worked?~

gita add -a .

to add them, worked.

nosarthur commented 1 year ago

the gita add -a generates groups automatically based on the folder structures (see the readme example), which may or may not be of the right grouping

gita add -r adds the repos without grouping them, then you can group according to your like