this post was submitted on 18 Nov 2023
3 points (100.0% liked)
Git
2541 readers
10 users here now
Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.
Resources
Rules
- Follow programming.dev rules
- Be excellent to each other, no hostility towards users for any reason
- No spam of tools/companies/advertisements. It’s OK to post your own stuff part of the time, but the primary use of the community should not be self-promotion.
Git Logo by Jason Long is licensed under the Creative Commons Attribution 3.0 Unported License.
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
ok, so a "merge request" can be viewed as "merge of branch1 into master will happen at a time I cannot control".
Now, branch1 is checked out, if I do
git switch -c branch2
, it will start a new branch2 based on the last commit from branch1, right? I feel it's safer, since I don't know when branch1 will merge, server-side.Exactly.
Depending on the upstream guidelines (check for a CONTRIBUTION file) you may open a MR with your initial development efforts. And reuse the branch until you have finished the feature. Then you request a review.
Or you may first mention your branch on a issue and only create the merge request once the entire feature is developed.
If you are developing another feature, use a dedicated branch.
In any case, the author merging may elect only specific portions of your change.
Also note that it is perfectly normal that a merge request will be open for months. So don't be discouraged. There may already be people profiting from your change. You just don't see it.
I think that you can add a WIP prefix to the MR title to prevent the maintainers from accidentally merging the branch prematurely.
If you have zero idea when but you assume it will be merged at some point, I think you've got the right idea.
Do you know the merge strategy of the remote? Is it fast forward only, merge commit, squash then merge commit?