Reputation: 569
Working on academic research I still haven't found a good git workflow for our project.
Setting: We have main project kept in branch master. When new idea emerges a new branch is created to support the research. Usually there is several parallel researches on the main project driven by different people.
When I am working on research branch R (it can take months, and many commits). Some of my commits are not directly connected with the research and are improving the project itself... I want to push these commits to master branch (they can be helpful for others).
How should I do this? Cherry-pick? It seems to me, that after lot of cherry-picks (from more people and different branches) it will be difficult to merge branch R with master at the end.
Maybe the better option is to switch to master before commit, make the commit, then switch back and pull updates from master. But this seems to be difficult, for three reasons:
What is the proper way of doing it?
Upvotes: 3
Views: 401
Reputation: 1326932
You could consider:
git rebase --interactive
: in order to reorder the commits, with the one you want on master
first, followed by the one specifics to R
master
) merge SHA1
(the right SHA1 of the last commit you want on master
)But that will change the history of the R
branch, which can be an issue of others have cloned it as well (you need to communicate clearly about that event, asking them to reset their R
branch to the new one you have changed and push).
Upvotes: 1