I have a public repo on GitHub that stores the latest updates of my project.
┌───────────────┐ ┌───────────────┐ ┌────────────────┐
│ │ │ │ │ │
│ GitHub │ Public │ GitHub │ Private │ GitLab │
│ │ contrib│ │ contrib │ │
│ Public fork ◄────────► Public repo │x─────────x│ Private mirror │
│ │ Create │ │ Cannot │ │
│ Downstream │ PR │ Upstream │ create PR │ Downstream │
│ │ │ │ (push/pull│ │
└───────────────┘ └───────────────┘ via local└────────────────┘
machine)
The contributions are done publicly and privately:
As I said, I have a GitLab mirror. It means that I do not make any changes to the main branch there, I only pull the changes from upstream. I know that there are things like bidirectional mirror which can probably be used in my case but is usually advised against doing for CAP theorem as so on.
As a result, the workflow for private contributions (pushing the changes from the private mirror on GitLab to the public repo on GitHub) is as follows:
There are the following things that I don't like about my workflow:
You can create two labels merged
and abandoned
to mark whether the MR was closed and merged on GitHub, or abandoned, respectively.
I'm not sure what you mean. If you frequently need to do 2b and 2c together, you can write a script that perform these two steps: (assuming remotegitlab
points to GitLab and remote github
points to GitHub)
#!/bin/bash
git pull gitlab "$@" && git push github "$@"
The script takes a branch name as its command line argument.