Repo Watch is a command-line tool for managing multiple Git repositories. It provides various commands to perform common tasks such as fetching changes from remote, pulling changes, cloning repositories, showing diffs, opening repositories in an IDE, and executing commands within repositories.
To install Repo Watch, you need to have Go installed on your system. Follow these steps:
-
Clone the repository:
git clone https://github.com/malbertzard/repowatcher.git
-
Change to the repowatcher directory:
cd repowatcher
-
Build the executable:
go build -o rw main.go
-
Add the executable to your system's PATH for easier access:
-
Linux/macOS: Move the
rw
executable to/usr/local/bin
or any other directory listed in your PATH. -
Windows: Add the directory containing the
rw
executable to your system's PATH.
-
Repo Watch provides the following commands:
-
add
: Add a repository to the config.rw add
-
add
: Create a repository and add it to the config.rw create
-
fetch
: Fetches changes from the remote repository for one or all repositories.rw fetch [nickname]
-
list
: Lists all repositories configured in theconfig.yaml
file.rw list
-
pull
: Pulls changes from the remote repository for one or all repositories.rw pull [nickname]
-
clone
: Clones a repository or all repositories.rw clone [nickname]
-
diff
: Shows the diff for a repository or all repositories.rw diff [nickname]
-
rdiff
: Shows the diff for a repository from the remote.rw rdiff [nickname]
-
edit
: Opens a repository in an IDE.rw edit [nickname]
- Opens the repository with the specified nickname in the configured IDE.
-
exec
: Executes a command in a repository.rw exec [nickname] [command]
- WIP
- Executes the specified command within the repository with the specified nickname.
For each command, you can use the -c
or --config
flag to specify a custom configuration file.
The configuration file (config.yaml) contains the settings for Repo Watch. It should be placed in the ~/.config/rw/ directory. Here is an example configuration:
---
rootFolder: /path/to/repositories
editCommand: code
repositories:
- nickname: repo1
folderName: repo1
url: https://github.com/user/repo1.git
sparse: true
- nickname: repo2
folderName: repo2
url: https://github.com/user/re
po2.git
sparse: false
rootFolder
: The root folder where the repositories will be cloned.editCommand
: The command to open a repository in the IDE.repositories
: A list of repositories to manage, each with the following properties:nickname
: A unique nickname for the repository.folderName
: The folder name for the cloned repository.url
: The URL of the remote Git repository.sparse
: Specifies whether the repository should be cloned sparsely (fetch only the current branch) or not.
-
Fetch changes from all repositories:
rw fetch --all
-
Clone a specific repository:
rw clone repo1
-
Open a repository in the configured IDE:
rw edit repo2
-
Execute a command within a repository:
rw exec repo1 'go test ./...'
Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request on the GitHub repository.
This project is licensed under the MIT License.