Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Orion/Git Workflows
Please enter in any Git Workflows you may have as a committer, non-committer or even as an OrionHub, GitHub or Localhost user.
If there are any workflows specifically not capable of being done in Orion, those are of special interest.
Contents
Workflows
Github Fork as Private Branch
I guess this is typical github use pattern.
- Fork a github project
- Clone into Orion
- Commit to new branch on Orion
- Push
- Use Pull request on GitHub
- Abandon your branch or entire fork.
Note that at step 5, your commit history is lost and irrelevant.
In theory you run into a problem if you Pull request is successful but then you continue to commit to the branch you used in the Pull request.
Serial Branches with Review-limited Upstream Commits
Here I am trying to move forward in small reviewable chunks that depend upon each other.
- Clone the git repo
- Create Feature1 branch
- Commit 1, 2, 3 (test interleaved).
- git fetch and rebase to master if it has advanced. Retest
- Submit patch for review (we use git cl, https://codereview.appspot.com)
- Create Feature2 branch from Feature 1.
- Commit 4,5.
- checkout FB1, the review is back from commits 1,2,3.
- git fetch rebase master if it has advanced, retest.
- git reset master # dump the changes from 1,2,3 onto your workspace
- git checkout master # now the changes are relative to master, re-test
- git commit -a -m "publically useful commit message with bug# and review URL"
- push to origin/master.
- checkout -b FB2.1 # relative to master
- cherrypick c4, c5 off branch FB2.
- retest and delete FB1 & FB2
Now you can go back to step 6 or 7.
Here is a picture:
branch from master to FB1 commit 1,2,3 on FB1 branch from FB1 to FB1.2 commit 4, 5 on FB1.2 squash commits 1,2,3 from FB1 into commit 6 on master
master C0 <--- C6 \ FB1 C1 <-- C2 <-- C3 \ FB2 C4 <-- C5
Goal: continue on FB2 with a history matching master
master C0 <--- C6 \ FB2 C4' <-- C5'
Resolve Merge Conflicts
The cause of conflicts has variations but here is a major one.
- You modify a file and save it.
- Someone else modified the same file and pushed it into remote.
- In git status page, you fetch and merge.
- You file is marked as conflicting.
- Open the side by side compare editor and resolve the conflicts.
- Stage the file and commit it.
- Push your file into remote.
For other variations and details, refer to test cases of resolving conflicts.