Simple Git Workflow
This workflow makes collaborative work easier by avoiding pull requests (which will be used later).
🛠 At project initiation
- A single person creates a Git and GitHub repository and then adds a minimal project structure.
- Push the initial changes to
main. - In GitHub, go to “Settings > Collaborators” and add each member of your team (to allow them to push when necessary).
- Everyone clones the repository locally.
📆 Everyday
- From the
mainbranch, create a new branch with the name of the feature, prefixed byfeature/(to specify that the branch is about a feature and not a bug fix for example). So, for a footer, you will create afeature/footerbranch:
git switch -c feature/footer
- Work on your branch: make commits until you have finished the feature.
- Return to the
mainbranch. You will find that the changes you made to thefeature/footerbranch are no longer visible. This is normal, they are still in thefeature/footerbranch. - Get the changes made in the meantime from the remote repository:
git pull origin main
- Merge your
feature/footerbranch from where you are (main):
git merge feature/footer
- Resolve conflicts if any.
- Commit, with a comment message.
- Push the new version of main:
git push origin main
🏁 At the end of the project (or at first demo)
- Enable deployment in “Settings > Pages”.