Skip to content

Latest commit

 

History

History
138 lines (76 loc) · 4.14 KB

File metadata and controls

138 lines (76 loc) · 4.14 KB

Project Management Manual

Overview

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 Commands

Basic Operations

Clone the repository:

git clone <repository_url>

Create a new branch:

git checkout -b <branch_name>

Switch to an existing branch:

git checkout <branch_name>

Check the status of changes:

git status

Add changes to the staging area:

git add .

Commit changes:

git commit -m "Commit message"

Push changes to the remote repository:

git push origin <branch_name>

Pull changes from the remote repository:

git pull origin <branch_name>

Advanced Branch Management

List all branches, local and remote:

git branch -a

Merge another branch into your current branch:

git merge <branch_name>

Delete a local branch:

git branch -d <branch_name>

Delete a remote branch:

git push origin --delete <branch_name>

Stash changes in a dirty working directory:

git stash

Apply stashed changes back to your working directory:

git stash pop

Working with GitHub Issues

Link a commit to an issue:

git commit -m "Fixes #123 - commit message"

Close an issue via commit message:

git commit -m "Closes #123 - commit message"

GitFlow Workflow

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.

Example GitFlow Commands

Starting development on a new feature:

git checkout -b feature/<feature_name> develop

Finishing a feature branch:

git checkout develop
git merge feature/<feature_name> --no-ff
git branch -d feature/<feature_name>
git push origin develop

Preparing a release:

git checkout -b release/<release> develop

Make necessary adjustments in the release branch

git commit -m "Final changes for release <release>"

Completing a release:

git checkout master
git merge release/<release> --no-ff
git tag -a <release>
git push origin master

Hotfix branch:

git checkout -b hotfix/<hotfix> master

Fix issues

git commit -m "Fixed <issue>"
git checkout master
git merge hotfix/<hotfix> --no-ff
git tag -a <hotfix>
git push origin master