Skip to main content

UCLA Moodle Workflow (using GIT)

Proposed workflows to accomplish what is illustrated in the diagram:

Option 1

git merge from a feature branch to develop, stage, and master as the feature graduates it’s way through the workflow.

Option 1

git merge —squash from the feature branch to develop. Subsequent merges can then be cherry-picked as the feature graduates its way through the workflow.

Option 1

git merge cherry-pick each revision from the feature branch to develop. Then continue to use git cherry-pick to merge features to stage and master as they graduate through the workflow

Notes and observations

Option1
  • Merges always originate from each feature branch
  • Feature branches stick around in origin for a long time
Option2
  • Squash all merges into a single commit.
  • This is exactly how SVN behaves.
  • Feature branches would have to stay around forever unless you are ok with losing all the history contained within them.
Option3
  • Feature branches are merged like normal, then you do cherry-pick’s to merge features up as they graduate to the next branch.
  • History is preserved in the first develop branch, but then gets lost in the subsequent branches.
  • This would be come nearly impossible to manage as you are having to manually cherry pick potentially hundreds of commits each time a feature or two pass on one of the earlier branches.

Appendix: Full list of commands

Option 1 Option2 Option3 1.

  • git checkout develop
  • git merge A
  • git branch -d A
  • git push origin develop
  • git checkout develop
  • git merge —squash A
  • git commit -m “merging feature A to develop”
  • git branch -d A
  • git push origin develop
  • git checkout develop
  • git merge A
  • git branch -d A
  • git push origin develop
2.
  • git checkout develop
  • git merge AB
  • git branch -d AB
  • git push origin develop
  • git checkout develop
  • git merge —squash B
  • git commit -m “merging feature B to develop”
  • git branch -d B
  • git push origin develop
  • git checkout develop
  • git merge B
  • git branch -d B
  • git push origin develop
3.
  • git checkout develop
  • git merge C
  • git branch -d C
  • git push origin develop
  • git checkout develop
  • git merge —squash C
  • git commit -m “merging feature C to develop”
  • git branch -d C
  • git push origin develop
  • git checkout develop
  • git merge C
  • git branch -d C
  • git push origin develop
5.
  • git checkout develop
  • git checkout B
  • start working on code
  • git checkout develop
  • git checkout B
  • start working on code
  • git checkout develop
  • git checkout B
  • start working on code
6.
  • git checkout stage
  • git merge C
  • git push origin stage
  • git checkout stage
  • git cherry-pick {revision from 3}
  • git commit -m “merging feature C to stage”
  • git push origin stage
  • git checkout stage
  • git cherry-pick {revisions in C}
  • git commit -m “merging feature C to stage”
  • git push origin stage
7.
  • git checkout stage
  • git merge A
  • git push origin stage
  • git checkout stage
  • git cherry-pick {revision from 1}
  • git commit -m “merging feature A to stage”
  • git push origin stage
  • git checkout stage
  • git cherry-pick {revisions in A}
  • git commit -m “merging feature A to stage”
  • git push origin stage
9.
  • git checkout master
  • git merge A
  • git push origin master
  • git push origin :A
  • git checkout master
  • git cherry-pick {revision from 7}
  • git commit -m “merging feature A to master”
  • git push origin master
  • git checkout master
  • ggit cherry-pick {revisions in A}
  • git commit -m “merging feature A to master”
  • git push origin master
10.
  • git checkout develop
  • git merge B
  • git branch -d B
  • git push origin develop
  • git checkout develop
  • git merge —squash B
  • git commit -m “merging feature B to develop”
  • git branch -d B
  • git push origin develop
  • git checkout develop
  • git merge —squash B
  • git commit -m “merging feature B to develop”
  • git branch -d B
  • git push origin develop
11.
  • git checkout stage
  • git merge B
  • git push origin stage
  • git checkout stage
  • git cherry-pick {revision from 10}
  • git commit -m “merging feature B to stage”
  • git push origin stage
  • git checkout stage
  • git cherry-pick {revisions in B}
  • git commit -m “merging feature B to stage”
  • git push origin stage
12.
  • git checkout master
  • git merge C
  • git push origin master
  • git push origin :C
  • git checkout master
  • git cherry-pick {revision from 6}
  • git commit -m “merging feature C to master”
  • git push origin master
  • git checkout master
  • git cherry-pick {revisions in C}
  • git commit -m “merging feature C to master”
  • git push origin master
13.
  • git checkout master
  • git merge B
  • git push origin master
  • git push origin :B
  • git checkout master
  • git cherry-pick {revision from 11}
  • git commit -m “merging feature C to master”
  • git push origin master
  • git checkout master
  • git cherry-pick {revisions in B}
  • git commit -m “merging feature C to master”
  • git push origin master