Skip to content

This will serve as a guide for implementing new project using git-flow work flow.

License

Notifications You must be signed in to change notification settings

arquizade/git-flow-implementation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 

Repository files navigation

💬Git Flow Project Implementation

This will serve as a guideline for implementing new projects using git flow workflow.


🔖 Git flow workflow diagram

Image by gitkraken.com Custom image inspired by Vincent Driessen in “A Successful Git Branching Model”.


🔖 Server design layout


💡 Getting Started

Installation process for windows, linux and mac

  • On macOS systems, you can execute brew install git-flow
  • On windows you will need to download git and install git-flow
  • On linux, execute sudo apt install git-flow
🎮 Initializing Git Flow

Execute this command in the project folder (master)

$ git flow init -d

(-d) = default

Initialized empty Git repository in ~/project/.git/
No branches exist yet. Base branches must be created now.
Branch name for production releases: [main]
Branch name for "next release" development: [develop]

How to name your supporting branch prefixes?
Feature branches? [feature/]
Release branches? [release/]
Bugfix branches? [bugfix/]
Hotfix branches? [hotfix/]
Support branches? [support/]
Version tag prefix? []

Then develop is set as working branch

$ git branch -a
* develop
 main
📌 Creating feature branch (start code edit) your@[DEV]develop-branch
$ git pull origin develop
$ git flow feature start feature_branch_name

...write your codes here then save the file, git add and commit

$ git add to_do_file
$ git commit -m 'update to do file'

...:memo: Developing a feature in collaboration use this commands

git flow feature publish feature_branch_name

feature in collaboration

📌 Finish feature branch (satisfied with the code) your@[DEV]develop-branch
$ git flow feature finish feature_branch_name
$ git push origin develop
📌 Release branch (for QA test) your@[STAGE]release-branch
$ git flow release start 0.1.0
Switched to a new branch 0.1.0

...:memo: To access by the QA execute this command and you can track:

$ git flow release publish 0.1.0
$ git flow release track 0.1.0

...:memo: Execute test here... :ship: if approved and release is stable and ready to ship, finish the release using the command below:

Note: if not approve do not execute this command..

$ git flow release finish 0.1.0
$ git push origin --tags

...:warning: if release encountered conflicts, issues or bugs

$ git flow bugfix start bugfix_branch_name release/0.1.0

...:crystal_ball: developer do the magic trick to fix the issue.. satisfied with the code

$ git flow bugfix finish bugfix_branch_name
$ git push

....:thumbsup: QA do the test again and when satisfied with the fix ..

$ git flow release finish 0.1.0
$ git push origin --tags

...:checkered_flag: when you excute the release finish command it will automatically merge to master and develop branch ~ but not in production server

📌 Deploying to production your@[PROD]master-branch
$ git pull origin master
📌 Maintenance or “hotfix” branches are used to quickly patch production release your@[DEV]develop-branch
$ git pull origin master
$ git flow hotfix start hotfix_branch_name
..
...
....
$ git flow hotfix finish hotfix_branch_name

...:wrench: then access the production server and execute the command your@[PROD]master-branch

$ git pull origin master

Note: hotfix command is created based on 'master branch' and if finish it will merge directly to the 'master branch'..


📎 Additional Command:

Showing the difference with the updated codes

$ git diff
diff --git a/index.html b/index.html
index d17f10e..6c12524 100644
--- a/index.html
+++ b/index.html
@@ -1,4 +1,4 @@
-edit line
+Title Header
 Lorem ipsum, dolor sit amet consectetur adipisicing elit. Sit fuga fugiat, asperiores dolor delectus atque iure.

Search any string value inside of your project

$ git grep -i -n 'type-the-text-to-search-here'

📺 Using git diff video explanation


📖 References

About

This will serve as a guide for implementing new project using git-flow work flow.

Resources

License

Stars

Watchers

Forks

Packages

No packages published