soda4fries / WIA1002_S2_24_occ9

Repo for Datastructure OCC9
MIT License
1 stars 15 forks source link

Tutorial on collaborating for group project and Lab Submission #18

Open soda4fries opened 4 months ago

jquan18 commented 4 months ago

Git Tutorial for OCC 9 Group Project

This tutorial is for OCC 9 group project.

Cloning a Repository

Cloning a repo, here's how you can do it:

  1. Open your terminal.
  2. Navigate to the directory where you want to clone the repository.
  3. Run the following command:

    git clone https://github.com/soda4fries/WIA1002_S2_24_occ9.git

Working Within Your Group's Subdirectory

Each group have their own subdirectory. Go to "Group Projects" and find your group name and ensure all your work is contained within your group's respectitive area.

Create a Git Branch

In Git, a branch is a new/separate version of the main repository.

Before starting your work, create a new branch to isolate your changes:

  1. Navigate to the respectitive group project directory.
  2. Create and switch to a new branch named after your feature or task:

    git checkout -b <new_branch_name>

eg:

    git checkout -b feature-123

checkout: This command is used to switch between branches. -b: This flag is used to create a new branch.

If you want to go back to master branch:

    git checkout master

Add Your Code Inside Branch

  1. Always remember to submit change on your group's subdirectory only. So switch to a branch first

    git checkout <existed_branch_name>
  2. Once you want to submit a change, stage your changes with:

    git add .

.: The dot represent the current and all of its subdirectories So by using 'git add .' Git will add all changes in the current directory and its subdirectories to the staging area.

  1. Commit Changes
    git commit -m "write anything u like. but better to write brief descriptive message of what you do"
  2. Push Your Branch
    git push origin <existed_branch_name>

Submit for Review

After pushing your changes, create a pull request for your branch on GitHub:

  1. On the GitHub repository page, navigate to "Pull requests" > "New pull request".
  2. Select your branch and provide a description of your contribution.
  3. Ask your team leader to review the pull request.

Team leader is the one stated inside the CODEOWNERS

For Team Leader

  1. Go to the "Pull requests" section of the GitHub repository.
  2. Select the pull request to review.
  3. Review the changes by pressing the 'Add your review' button.
  4. Leave comments, approve, or request changes as necessary.
  5. Merge the pull request into the main project branch.
jquan18 commented 4 months ago

Git tutorial for Lab Subission

Lab Submission

For lab submissions, we follow a peer review process. Everyone in the occ 9 has the opportunity to review and approve someone's submissions. Here’s how it works:

Submitting Your Lab Work

  1. Ensure that you are working on the correct branch for your lab submission. If not, create a new branch:

    cd Labs/<your_matric_number>
    git checkout -b <new_branch_name>

    Important Reminder: Always ensure you are working within your own designated directory.

  2. Commit and push your changes to the branch:

    git add .
    git commit -m "Lab X submission - Name"
    git push origin <branch_name>
  3. Go to the GitHub repository page, navigate to "Pull requests" > "New pull request".

  4. Select your branch for the lab submission and create a new pull request. Make sure to provide a descriptive title and description of your lab work.

Reviewing Lab Submissions

Everyone in OCC 9 can review each other lab submission.

  1. Go to the "Pull requests" section of the GitHub repository to see all open pull requests.
  2. Select a pull request you want to review.
  3. Review the changes. Look for correctness, completeness, and other based on the lab.
  4. Leave comments on any lines of code where you have suggestions or questions. You can do this by clicking on the line of code and then clicking the "Add single comment" or "Start a review" button.
  5. If you approve of the changes and believe they are ready to be merged, you can leave an overall comment saying so and then click "Approve" in the review changes section.

Merging Lab Submissions

For lab submissions, we adopt a more flexible approach where any group member can merge the pull request once it has received sufficient approvals (e.g. a approvals from different members).

  1. Once your pull request has received someone's approve.
  2. Click on "Merge pull request" to merge the changes into the main branch. If there are no conflicts, you can choose the "Confirm merge" option.
  3. After merging, it’s a good to delete the branch to keep the repository clean, which can be done by clicking "Delete branch" post-merge.