This document serves as a brief primer on the different Git and GitHub workflows you can leverage to effectively run a project with more than one contributor. Our intent in creating this document is to create a resource that you can revisit every time you are involved in a collaborative project, from the inception of the project (repo setup, task assignment, etc.) to the intricacies of development (branching, merges, etc.). We leave out much of the esoteric nuances of Git, but we encourage you to research such things on your own.
.gitignore
main/
vs. dev/
vs. feat/*
convention
dev/
is often overkill, esp in MDST scenario, so it suffices to cover main
branch vs. feat
branchesGit is a distributed version control system that tracks changes to files and coordinates work on those files among multiple people, allowing for collaboration as well. Internally, Git uses a combination of snapshots and differences (diffs) to keep track of changes in your project. When you make a ‘commit’, Git stores a snapshot of all the files in our project at that point in time (think of it as a save point).
By initializing a Git repository, you now have some storage space where your project files are kept along with their entire version history, allowing you to track changes, revert to previous states, and collaborate with others.
GitHub is a web-based platform that hosts Git repositories in the cloud. GitHub makes it easy for developers to collaborate on projects by sharing their Git repos online. Multiple people can contribute to a project, review each other’s code, and track issues. GitHub also offers additional features like GitHub Actions for CI/CD, GitHub Pages for hosting static websites, and GitHub Copilot for AI-assisted coding.
In a collaborative development environment, GitHub provides two main methods for contributing to a project. One is Direct Access, and the other is Fork & PR.
Direct Access
With direct access, contributors are given permission to push changes directly to the repository. This method is typically used for smaller teams or when contributors are trusted collaborators.
Here are the steps to contribute to a repository using direct access, assuming permission is granted: