Skip to content

Vasanth1602/git_workflow-task

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Git Workflow Implementation Documentation

Purpose

This task involves implementing a Git workflow using the following branches:

  • feature/* - For new features and bug fixes
  • dev - For integrating and testing features
  • release/* - For preparing code for production
  • main - For stable, production-ready code

This structured workflow helps to organize code changes, improve collaboration, and prepare for CI/CD automation in a DevOps environment.

Git Workflow Overview

  1. Feature Branches (feature/*):

    • Purpose: Used for working on individual features, bug fixes, or any isolated changes.
    • Lifecycle:
      • Create a feature branch from dev.
      • Work on the feature and push changes.
      • Open a Pull Request (PR) to merge the feature into dev.
  2. Development Branch (dev):

    • Purpose: The integration branch where all features are merged.
    • Lifecycle:
      • After each feature is completed, it's merged into dev.
      • The dev branch should always contain code that is ready for testing.
      • Automated tests should run on this branch (via CI/CD).
  3. Release Branches (release/*):

    • Purpose: Used for final bug fixes, versioning, and preparing code for production.
    • Lifecycle:
      • When dev is stable and ready to be deployed, create a release/* branch.
      • The release branch undergoes final testing, versioning, and bug fixes.
      • Once validated, it's merged into main and tagged for production release.
  4. Main Branch (main):

    • Purpose: Holds stable, production-ready code.
    • Lifecycle:
      • Only merged into from release/* branches.
      • Automatically deployed to production (via CI/CD tools).

Step-by-Step Workflow

1. Initialize Git Repository

git init

2.Create and Switch to the dev Branch

git checkout -b dev

3. Create and Push a Feature Branch

git checkout -b feature/<feature-name> git commit -am "Add feature: <feature-name>" git push -u origin feature/<feature-name>

4. Open a Pull Request (PR) to Merge Feature into dev

Go to GitHub, open a Pull Request from feature/ to dev.

5. Create a release/* Branch from dev When Ready for Production

git checkout dev git pull git checkout -b release/v1.0

6. Merge release/* into main and Tag for Production

git checkout main git merge release/v1.0 git tag -a v1.0 -m "Release version 1.0" git push origin main --tags

7. Merge release/* Back into dev to Keep It Updated

git checkout dev git merge release/v1.0

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors