Skip to main content

Branch Structure

Horse Trust uses a structured Git workflow to maintain code quality and enable smooth collaboration.

Branch Types

  • main - Production branch, always stable and deployable
  • dev - Development branch, integration branch for features
  • feature/* - New functionality branches
  • fix/* - Bug fix branches
NEVER push directly to dev or main branches. Always work in feature or fix branches and create pull requests.

Creating a New Branch

Step 1: Update Your Local Repository

Always start from an updated dev branch:

Step 2: Create Your Feature Branch

Use descriptive branch names that clearly indicate the purpose:
Good branch names:
  • feature/user-authentication
  • feature/donation-tracking
  • fix/login-redirect-error
  • fix/broken-api-endpoint
Bad branch names:
  • feature/update
  • fix/bug
  • test-branch

Making Changes

Development Best Practices

  1. Write clean, documented code - Make your code easy to understand
  2. Follow project conventions - Maintain consistency with existing code
  3. Add tests - Include tests for new functionality
  4. Test thoroughly - Ensure all tests pass before committing

Commit Conventions

We follow Conventional Commits specification for clear and structured commit history.

Commit Format

Commit Types

  • feat - New feature
  • fix - Bug fix
  • docs - Documentation changes
  • style - Code formatting (no functional changes)
  • refactor - Code refactoring
  • test - Adding or modifying tests
  • chore - Maintenance tasks

Commit Examples

Good commits:
Bad commits:

Pushing Your Changes

Once you’ve committed your changes, push them to the remote repository:

Creating a Pull Request

Step 1: Open a Pull Request

  1. Go to the GitHub repository
  2. Click “New Pull Request”
  3. Set the base branch to dev
  4. Set the compare branch to your feature/fix branch

Step 2: Fill Out the PR Template

Provide comprehensive information: Required information:
  • Description - Clear explanation of what changes you made and why
  • Screenshots - Visual evidence of changes (if applicable)
  • Checklist - Mark completed tasks:
    • Code follows project standards
    • All tests pass
    • Documentation updated
    • No breaking changes (or documented if necessary)

Step 3: Assign Reviewers

  • Assign the repository maintainer as a reviewer
  • Add relevant team members if needed

Step 4: Wait for Review

  • Automated tests will run automatically
  • The repository maintainer will review your code
  • Be responsive to feedback and requested changes

Review Process

What to Expect

  1. Automated Checks - CI/CD pipeline runs tests automatically
  2. Code Review - Repository maintainer reviews your changes
  3. Feedback - You may be asked to make changes
  4. Approval - Once approved, the maintainer will merge to dev

Review Checklist

Reviewers will check:
  • Code quality and readability
  • Adherence to coding standards
  • Test coverage
  • Documentation completeness
  • No security vulnerabilities
  • Performance considerations
All tests must pass before a PR can be merged. Make sure to run tests locally before pushing.

After Your PR is Merged

Once your pull request is merged:
  1. Delete your feature branch (GitHub will prompt you)
  2. Update your local repository:
  3. Start working on your next contribution!

Important Rules

  • NO direct pushes to dev or main
  • Always work in feature/fix branches
  • All tests must pass before creating a PR
  • Wait for approval before merging

Getting Help

If you have questions about the Git workflow:
  • Contact the repository maintainer
  • Reach out to the team: S02-26-Equipo-33-Web-App
  • Review this documentation

Additional Resources