When there are multiple collaborators on a project, there a few steps that I always take. Here are my suggestions for your next group project.

Create branches based on features. For example, if one of your features in the project is a header. Create a branch for that header where you work on code relevant to that feature. To create a new branch run the following code in the terminal.

git branch branch_name

When you are ready to commit changes, first add the files you want to commit to the staging area.

git add file_name

Commit your changes.

git commit -m "commit message"

And push to your branch.

git push -u origin branch_name

When you are ready to merge all of your changes into the main branch, you can create a pull request in Github. After someone other than yourself has reviewed your code and merged it into main, you can pull down all of the changes into your local main branch by doing the following.

git checkout main
git fetch
git pull

If you would like to merge the changes from the main branch into a feature branch, do the following.

git checkout branch_name
git merge main

At this point, all of your changes should be in the main branch, and your feature branch should include all of those changes.