Hello,
I am working with `git-repo` in the context of Apache Maven (133 repos) and have some questions (hoping to be right here, otherwise I appreciate hints to other resources).
Is there a tutorial around for git-repo or some howto-docs for typical use cases? I'd be happy to read and try out first before bothering with more detailed questions.
As far as I understand, the repo tool is great to work with a large number of repositories and was therefore introduced to Apache Maven. But I guess it works nicely, if you already have commit access to all repositories?
In my case (and perhaps others) the situation is different, as I am not a committer to the repos but rather a contributor who tries to help out with several cross-repository issues. I have to work with forks of the respective repositories.
For example a usual workflow for me is
- I want to make changes to several repositories, but have to fork them first (at least on first change, later I can re-use my forks of course)
- I perform my changes applying them to branches in my forks
- I raise PRs for my changes
- Acceptance takes its time, at least days, sometimes weeks
- Meanwhile development by other people goes ahead in parallel. This results in some necessary rebases for my PRs every now and then or even redrawals if my proposed changes become obsolete or need larger rework.
While I wait for some work to be accepted, I can start working on another topic., lets call this an overall branch (or do you have a better name?). However, keeping track of all of my work branches is not so easy.
Typical activities are
- Start a new branch (of work)
- Add more repositories to the branch (as I detect that changes are necessary across repositories on that branch)
- Finalize work on the branch by commiting (to several repositories)
- Creating PRs on the branch (on several repositories)
- Tracking the PRs and the overall state
- Relieving repos from the branches when PRs are accepted and merged, by
- Switching back to the respective trunk (master or main)
- Sometimes even switching back from the fork to the upstream
- Rebasing my branch/fork when upstreams are changed due to other activities
- Switching back and forth between different branches.
Perhaps I am not the first person running into this challenge and someone has already documented good ways to perform these tasks. I guess most of them can be easily achieved with the repo CLI using respective parameterisation?
Any hints are appreciated!
In the future I'd also be happy to work with worktrees but this also affects overall build and IDE handling (IntelliJ).
Thanks
Gerd