Git & GitHub Workflow Guide for Teams

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:

    git clone https://github.com/<organization>/<repository>.git
    cd <repository>

🔄 2. Daily Workflow

Every developer should follow this routine:

  1. Always start by pulling the latest code:

    git pull origin main
  2. Create a new branch for your work (never commit directly to main):

    git checkout -b feature/your-feature-name

    Use clear branch names: feature/login, bugfix/header-alignment, hotfix/payment.

  3. Develop and stage your changes:

    git add .
    git commit -m "Added product list page"
  4. Push your branch to GitHub:

    git push origin feature/your-feature-name
  5. Open a Pull Request (PR) on GitHub:

    • The code will be reviewed by team members.

    • After approval, it will be merged into main.

  6. After merge: Update your local main branch:

    git checkout main
    git pull origin main

📝 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 pull before 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)

# Clone repository

git clone <repo-url>
cd <repo>

# Pull latest code

git pull origin main

# Create new branch

git checkout -b feature/feature-name

# Stage & commit changes

git add .
git commit -m "Descriptive message"

# Push to GitHub

git push origin feature/feature-name

# Merge via Pull Request (on GitHub)

# Switch back to main and update

git checkout main
git pull origin main

✅ 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.

War dieser Artikel hilfreich?