This article explains how teams should work with Git and GitHub to ensure clean, collaborative, and conflict-free development. The goal is to keep the codebase organized, avoid conflicts, and maintain a transparent workflow.
🔑 1. Accessing the Repository
-
All project code is stored in GitHub repositories.
-
Access is granted by being added as a collaborator or as part of a team within the organization.
-
Once access is granted, clone the repository to your local machine:
🔄 2. Daily Workflow
Every developer should follow this routine:
-
Always start by pulling the latest code:
-
Create a new branch for your work (never commit directly to
main):Use clear branch names:
feature/login,bugfix/header-alignment,hotfix/payment. -
Develop and stage your changes:
-
Push your branch to GitHub:
-
Open a Pull Request (PR) on GitHub:
-
The code will be reviewed by team members.
-
After approval, it will be merged into
main.
-
-
After merge: Update your local
mainbranch:
📝 3. Commit Message Guidelines
-
Commit messages should be clear and descriptive.
-
Examples:
-
✅
"Implemented user authentication" -
❌
"fix"or"temp changes"
-
🚨 4. Handling Conflicts
-
If two people change the same lines of code, a merge conflict will occur.
-
Git will mark the conflicting lines, and the developer must decide which version to keep.
-
After resolving conflicts, commit and push again.
🧭 5. Key Rules
-
Never commit directly to
main. Use feature branches + Pull Requests. -
Always
git pullbefore starting new work. -
Keep branches short-lived (merge them back as soon as the feature is done).
-
Use meaningful commit messages and consistent language (English is recommended).
-
Review PRs carefully before merging.
📌 6. Quick Reference (Cheat Sheet)
✅ Benefits of This Workflow
-
Centralized code management.
-
Parallel development without overwriting each other’s work.
-
Transparent change history.
-
Reduced conflicts and easier collaboration.
👉 This article can be copied directly into your Knowledge Base or Confluence/Notion.