Issue Merge Request (MR) for features


      This file only relates to  GitLab.
      Click here to view the  GitHub Version
    

This will show you how to do git-flow style of committing. Ideal guidelines is that we never commit anything to master directly. So instead, we make use of branches where we will do our code/feature/implementation/whatever and then we will issue a Merge Request (MR) to commit said code back to master. This way we are able to do extra validation on our code through code review by Continuous Integration (CI) servers or other collaborators. This will ensure that bad code will never be found on master

Note: Basically most of the features should follow this flow (everything on a branch and changes back to master through a Merge Request). This way it will allow us to do our own issues simultaneously effectively
  1. Click the Branch button to create a new branch
  2. Enter your desired branch name (To sort the branch to folders, append / to the branch name)
  3. Click Create Branch to confirm branch creation
    GitLab MR #1
  4. Do your necessary code implementation/fixes/changes
    (See Pull from origin, Commit Code, Push to origin)
  5. When it is all done, head over to the repo project page
  6. You should be able to see your branch name that you just pushed at the top of the page, and select Create merge request
    GitLab MR #2
  7. Note: If it does not show up, manually create the MR by going to the Merge Requests page and select "New merge request", after which select your branch in the "Select source branch" dropdown box
  8. Enter your Merge Request Title and Descriptions accordingly if needed. Also modify the settings at the bottom if you need to do so
    GitLab MR #3
  9. Double check that the branch you are merging to is correct and review your changes again
  10. When you are done, create the MR by clicking the green Submit merge request button
    GitLab MR #4
  11. Now we play the waiting game until a green tick appears and it says All checks have passed (Note: If it fails, your code is not compiling and needs to be fixed)
  12. If all checks have passed, either you or anyone else can go ahead and click the green Merge button
    GitLab MR #5
  13. Ensure that it says your merge request has been merged
    GitLab MR #6
  14. When you are done you can switch back to the master branch (you may now delete the branch if you want, though its entirely optional)
    GitLab MR #7
Demo Video
The following is a video on how this is being done. Read the how-to guide before watching the video for actual steps to do it

Console Commands Used

      git checkout -b "branchname" # Checkouts a new branch
      git add [-A] "file" # Adds file to Commit
      git commit -m "Message" # Commits messages
      git push # Push commits to GitLab
      git checkout master # Go back to master
      git branch -d "branchname" # Deletes the branch