Welcome to the backend repository. This guide outlines how we collaborate using Git, manage our branches, and contribute code efficiently.
We use the following branches:
dev
: Active development (CI/CD enabled)main
: Stable, reviewed codeprod
: Production deployment (CI/CD enabled)
All development happens on feature branches and is eventually merged into dev
, then into main
and then to prod
.
Start by forking the main repository to your own GitHub account.
git clone https://github.com/your-username/your-forked-repo.git
cd your-forked-repo
git remote add upstream https://github.com/ThryzenX/Backend.git
Always start from the latest dev
branch in the upstream repository.
git fetch upstream
git checkout -b feature/your-feature-name upstream/dev
Make your changes, then commit them with a clear message:
git add .
git commit -m "feat: add login endpoint"
git push origin feature/your-feature-name
- Go to your forked repository on GitHub.
- Open a pull request from your
feature/*
branch to thedev
branch of the main repository. - Once merged Check your changes on development server.
- if everything works fine then create a pr from dev branch to main branch .
Once merged, your changes will be included in the stable codebase.
To stay synced with the main repository:
git fetch upstream
git checkout main
git merge upstream/main
git push origin main
Use clear and conventional commit messages:
feat:
for new featuresfix:
for bug fixeschore:
for general maintenancedocs:
for documentationrefactor:
for code improvementstest:
for adding or updating tests
Example:
git commit -m "feat: implement JWT authentication"
- Work is pushed to feature branches and merged into
dev
then upon verification on the dev server it will be merged tomain
. - Once verified,
main
is merged intoprod
- CI/CD automatically deploys
dev
andprod
branches
Stay consistent, sync regularly, and write clean commits.