This manual provides detailed instructions and commands for managing the development environment and workflow using Git, Docker, and pytest. It is tailored for a project that uses a Docker Compose setup involving multiple services including PostgreSQL, PGAdmin, FastAPI, and Nginx.
git clone <repository_url>
git checkout -b <branch_name>
git checkout <branch_name>
git status
git add .
git commit -m "Commit message"
git push origin <branch_name>
git pull origin <branch_name>
git branch -a
git merge <branch_name>
git branch -d <branch_name>
git push origin --delete <branch_name>
git stash
git stash pop
git commit -m "Fixes #123 - commit message"
git commit -m "Closes #123 - commit message"
GitFlow is a branching model for Git, designed around the project release. This workflow defines a strict branching model designed around the project release. Here’s how it typically works:
- Master/Main Branch: Stores the official release history.
- Develop Branch: Serves as an integration branch for features.
- Feature Branches: Each new feature should reside in its own branch, which can be pushed to the GitHub repository for backups/collaboration. Feature branches use develop as their parent branch. When a feature is complete, it gets merged back into develop.
- Release Branches: Once develop has acquired enough features for a release (or a predetermined release date is nearing), you fork a release branch off of develop.
- Hotfix Branches: Maintenance or “hotfix” branches are used to quickly patch production releases. Hotfix branches are a lot like release branches and feature branches except they're based on master/main instead of develop.
In collaborative environments, especially on platforms like GitHub, GitFlow provides a robust framework where multiple developers can work on various features independently without disrupting the main codebase. Testing should be integral at various stages:
- Feature Testing: Each feature branch should be thoroughly tested before it is merged back into develop.
- Release Testing: Before a release is finalized, comprehensive testing should be conducted to ensure all integrated features work well together.
- Post-release: Hotfix branches allow quick patches to be applied to production, ensuring any issues that slip through are addressed swiftly.
This workflow supports continuous integration and deployment practices by allowing for regular merges from development to production branches, with testing checkpoints at crucial stages.
git checkout -b feature/<feature_name> develop
git checkout develop
git merge feature/<feature_name> --no-ff
git branch -d feature/<feature_name>
git push origin develop
git checkout -b release/<release> develop
git commit -m "Final changes for release <release>"
git checkout master
git merge release/<release> --no-ff
git tag -a <release>
git push origin master
git checkout -b hotfix/<hotfix> master
git commit -m "Fixed <issue>"
git checkout master
git merge hotfix/<hotfix> --no-ff
git tag -a <hotfix>
git push origin master