Blogging With Git Flow

Git Flow is an add-in for Git, that helps us to follow the feature branch process in a standard way. We usually use our Jira ticket number as names for features, bugs, or hotfixes, and we use the Jira Version as a Release name. This makes absolute sense to us and makes the flow pretty transparent. We also use BitBucket to host our Git repositories, which is directly linked to Jira. That means on every Pull Request we have the direct link to the Jira ticket.

Using Git Flow, I don’t need to use the _drafts folder anymore. Every unfinished feature branch is a draft. If I finish a post, I would just need to finish the feature branch. If I want to publish the posts, I can start a new release.

This blog post feature branch is created by using the following commands in the console:

git flow feature start blogging-with-git-flow

Now I’m in the draft mode and will create the blog post file, writing, adding images, linking between existing posts, and so on. If this is done I do a first commit and publish the feature branch to GitHub:

git add _posts/*
git add img/*
git commit -m "new post about blogging with pretzel"
git flow feature publish

If I finish the blog post, I’m going to finish the post and push the current develop branch to GitHub:

git flow feature finish
git push

The last step is publishing the posts

git flow release start 1.48.0
git flow release finish
git push --all
git push --tags

https://dzone.com/articles/blogging-with-git-flow