What a tedious and confusing task it is to manage multiple repositories!
Multiple repositories where few of them were copies of same repos but on different branches.
So I have assembled the
list-repos utility to solve the at-least few bits of this problem by listing the repository directories and their active branches to quickly decide on the target directory to work on.
In the beginning I had created a shell based solution which was very brittle and accepted no input. It changed the directories and echoed the active branch.
Later the script got modified to do shell loops and had one hard-coded value. It was looking good but still brittle as it had one hard-coded value in terms of the directory to look into.
To install it on your system, simply type the following command and hit enter:
npm i -g list-repos
And to use it, type following command and hit enter:
<dir-path> in above command is the path where all the copies of repositories are. Hence for above hardcoded example,
/c/xampp/htdocs is the directory where the copies are, command will be
And on running above command, it will generate output like following:
This utility can accept the relative paths. So suppose I am in any of the above directories, I can launch the utility with
.. to get the list in following way and will generate same output as above:
Please use the tool and let me know if you think of any new feature or encounter any problem in the comments. The tool is open source and can be forked from https://github.com/pankajpatel/list-repos