Skip to content

A step-by-step demonstration of GitFlow branching model with visualizations. Includes examples of feature development, releases, and hotfixes.

License

Notifications You must be signed in to change notification settings

vedanta/gitflow-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

GitFlow Sample

Step-by-step demonstration of GitFlow workflow with visualizations.

Installation

git clone https://github.com/yourusername/gitflow-sample.git
cd gitflow-sample

Steps

1. Initial Setup

mkdir gitflow-sample
cd gitflow-sample
git init
echo "print('Hello World')" > main.py
git add main.py
git commit -m "Initial commit"
gitGraph
    commit id: "initial"
Loading

2. Create Develop Branch

git branch develop
git checkout develop
gitGraph
    commit id: "initial"
    branch develop
    checkout develop
Loading

3. Feature Branch

git checkout -b feature/add-name-input
# Update main.py with name input
git add main.py
git commit -m "Add name input feature"
git checkout develop
git merge feature/add-name-input
gitGraph
    commit id: "initial"
    branch develop
    checkout develop
    branch feature/add-name-input
    checkout feature/add-name-input
    commit id: "name input"
    checkout develop
    merge feature/add-name-input
Loading

4. First Release

git checkout -b release/1.0
# Update version
git add main.py
git commit -m "Bump version to 1.0"
git checkout main
git merge release/1.0
git tag -a v1.0 -m "Version 1.0"
git checkout develop
git merge release/1.0
gitGraph
    commit id: "initial"
    branch develop
    checkout develop
    branch feature/add-name-input
    commit id: "name input"
    checkout develop
    merge feature/add-name-input
    branch release/1.0
    checkout release/1.0
    commit id: "bump 1.0"
    checkout main
    merge release/1.0 tag: "v1.0"
    checkout develop
    merge release/1.0
Loading

5. Hotfix

git checkout main
git checkout -b hotfix/input-error
# Fix bug in main.py
git add main.py
git commit -m "Fix input validation"
git checkout main
git merge hotfix/input-error
git tag -a v1.0.1 -m "Version 1.0.1"
git checkout develop
git merge hotfix/input-error
gitGraph
    commit id: "initial"
    branch develop
    checkout develop
    branch feature/add-name-input
    commit id: "name input"
    checkout develop
    merge feature/add-name-input
    branch release/1.0
    commit id: "bump 1.0"
    checkout main
    merge release/1.0 tag: "v1.0"
    checkout develop
    merge release/1.0
    checkout main
    branch hotfix/input-error
    commit id: "fix input"
    checkout main
    merge hotfix/input-error tag: "v1.0.1"
    checkout develop
    merge hotfix/input-error
Loading

Releases

  • v1.0: Initial release with name input feature
  • v1.0.1: Hotfix for input validation

License

MIT License

About

A step-by-step demonstration of GitFlow branching model with visualizations. Includes examples of feature development, releases, and hotfixes.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages