• Skip to primary navigation
  • Skip to main content
  • Skip to footer
Code The Dream School
Code the Dream Labs Logo

Code The Dream School

Main hub for class materials for Code the Dream’s classes

  • Code the Dream Home

Search Code The Dream School

Git Process for Closed Source Projects

The flow is triangular. Write access to the main branch on Github is restricted to certain reviewer/committers. Other team members will just have read access to this branch on github.

Setting Up for the Git Process

Go to the directory where you would like to do your work, and clone the repository.

Git Process for Features

  1. git checkout main (always start your new feature branch here)
  2. git pull origin main (make sure you are up to date)
  3. git checkout -b your-feature-name (Do not make changes to the main branch. Note: If you forget, there are ways to save your changes and to get the master branch back the way it was. For example, if you have not committed changes, you can use git stash, then create the feature branch, then do git stash apply.)
  4. Develop your feature.
  5. Add and commit your changes.
  6. Push your feature branch. This should be done periodically, even before you are done with your feature, so that you don’t lose your work.
  7. Test your feature, including any automated testing if the project has it. Make any changes necessary to make the tests pass.
  8. Commit and push your changes again.
  9. git checkout main (You need to merge in any changes that your colleagues have made in the meantime.)
  10. git pull origin main
  11. git checkout your-feature-name
  12. git merge main (Now, at this point, if anyone has made changes to the same files you changed, you will need to resolve merge conflicts.)
  13. Resolve merge conflicts, if any, and add and commit your changes.
  14. Test again to make sure the merge conflict resolution did not break anything.
  15. Push your changes
  16. Do a pull request on github. The target of the pull request must be the main branch.
  17. A reviewer/committer will review your code and may request changes.
  18. Make any necessary changes to the your-feature-name branch and test the result. Then add, commit, and push again. It is not necessary to create a new pull request, as your changes will be added to the existing pull request.
  19. Once all required changes have been made, the committer will merge your code.
  20. Time for a new feature branch!

Footer

Copyright © 2025 Code the Dream School | All Rights Reserved | Privacy Policy