Logo

dev-resources.site

for different kinds of informations.

Git Github Gitflow

Published at
12/12/2018
Categories
git
github
gitflow
illustration
Author
annlin
Categories
4 categories in total
git
open
github
open
gitflow
open
illustration
open
Author
6 person written this
annlin
open
Git Github Gitflow

What is Git

Git is a distributed version control system created by Linus Torvalds in 2005. The same guy who created linux. Genius.

Centralized vs Distributed

Before Git, Apache Subversion (SVN) was one of the popular version control systems. SVN is a centralized version control system which stores all the files in 1 central server. If two developers are working on the same file, they will have to resolve conflicts all the time. The developers cannot commit the changes if they are offline unlike Git.

On the other hand,

Git commands

Below is a list of basic commands to save your changes as commits and push them up to the server (Github) using Terminal. I'm a terminal person. No GUI. I know that VSCode has built-in user interface for git. There are existing Git Clients too.

git checkout develop # Go to develop branch
git add . # add all the files you have edited
git commit -m "Add changes to the files" # add commit message to the files you've added
git push origin master # Push the commits to master branch in the server
Enter fullscreen mode Exit fullscreen mode

Check out this git cheatsheet

Github

A hosting service that works with Git. There are alternative hosting services that work with Git as well. For example, Bitbucket and Gitlab. However, I like Github the best because the UX is smooth af. FYI, Microsoft acquired Github and I find this tweet hilarious.

Gitflow

A popular branching strategy created by Vincent Driessen. My team at HOOQ is using it. We use it together with Git Hubflow and we are puking rainbow. There's no right or wrong branching strategy, you just have to find the most suitable model that suits your team.

Trunk-Based Development Workflow

Everyone works on master branch only. This is useful to avoid long lived branches which result in accumulating merge conflicts.

Branches

  1. Master branch

Pros

  • Force developers to do small commits and changes frequently
  • Easy to understand
  • Iterate quickly, ship faster

Cons

  • Incomplete features may be released if no feature flag is used
  • Introduce bugs easily
  • Frequent merge conflicts if developers work on the same files

Gitflow Workflow

Master branch is the stable branch. Nobody touches it. Everyone works on their own feature branch then opens a pull request to merge feature branch into develop branch. A release branch is branched out from develop branch and then merged back to master and develop branches. This encourages continuous delivery.

Branches

  1. Master branch
  2. Develop branch
  3. Feature branch
  4. Release branch
  5. Hotfix branch

Pro

  • Easy to work in parallel
  • Release branch is useful to track releasable features

Cons

  • A little complicated for first time user

I will direct you to an authentic Gitflow explanation over here by the creator himself.

Git Hubflow

One-line commands for using Gitflow with Github. This amazing tool is created by DataSift You guys are da MVP.

Normal Git commands

git checkout develop
git pull origin develop
git checkout -b release/production-1.0.0
git add .
git commit -m "Add new release"
git push origin release/production-1.0.0
git checkout master
git pull origin master
git merge release/production-1.0.0
git tag production-1.0.0
git push --tags origin production-1.0.0
git checkout develop
git pull origin develop
git merge master
git push --delete release/production-1.0.0
Enter fullscreen mode Exit fullscreen mode

Amazing Git Hubflow Commands

git hf release start production-1.0.0
git add .
git commit -m "Add new release"
git hf release finish production-1.0.0
Enter fullscreen mode Exit fullscreen mode

What is the best workflow?

There are numerous factors to consider when deciding what is the best branching strategy for your team. Does your team require continuous delivery? How comfortable are your team members adopting an entire new workflow versus tweaking existing workflow to suit their needs?

Personally, I like gitflow because of the separation of concerns for different features and the ease of creating a release with releasable features. But I do believe there is no single best workflow.

There are more articles over here and here that compare different workflows and their benefits.

Disclaimer

I have not tried SVN. Not entirely true, I tried playing with SVN but it was too complicated for my liking. I am spoiled by git. There may be parts in the illustration that are inaccurate, please correct me!

Also talk to me at Twitter @linxea_. I'm bored over there.

Also, I made a slide for my workshop tomorrow at https://linxea.github.io/git-github-gitflow. Feeling fancy with reveal.js.

References

https://docs.microsoft.com/en-us/azure/devops/repos/git/git-branching-guidance?view=vsts
https://datasift.github.io/gitflow/IntroducingGitFlow.html
https://www.endoflineblog.com/oneflow-a-git-branching-model-and-workflow

illustration Article's
30 articles in total
Favicon
Streamlining Your Design Workflow: Essential Tools and Techniques for 2024
Favicon
THE DIFFERENT BETWEEN LIBRARY AND FRAMEWORK AND NOT USING BOTH WITH REAL LIFE  ILLUSTRATIONS
Favicon
Mastering the Art of Design: A Dive into Fundamental Principles
Favicon
🎁 Collection of free illustrations for OpenGraph images
Favicon
Ilustrador o profissional dos desenhos
Favicon
Brand Illustration System and Its Impact on Business Identity
Favicon
Illustration Trends to Dominate Over the Web at 2022
Favicon
Adventure Camping Night Illustration
Favicon
Recomendações de sites para baixar ilustrações
Favicon
Design in minutes.
Favicon
Little Koala
Favicon
Garfield bored face using css and html
Favicon
Best resources for #developers
Favicon
FREE 3D ILLUSTRATION LIBRARIES
Favicon
Nice illustrations for websites
Favicon
Covtact: It's about first impressions [DO-Hackathon]
Favicon
17 - Turning static into fantastic with Erica Jacobs
Favicon
Drawing a Giraffe with CSS
Favicon
Illustrated Notes on Advanced JavaScript Fundamentals
Favicon
Children's Book Illustrator Portfolio
Favicon
Illustrating a Book for Young Adults
Favicon
Big Heads - Easily generate characters for your projects
Favicon
One Place to look for sites offering Free Illustration Resources
Favicon
Create a moving BOT illustration using CSS
Favicon
Award-Winning UI UX Design Company
Favicon
5 Reasons to Choose Mobile App Development Company in California
Favicon
A Fresh Serving of JavaScript ES2019
Favicon
CSS Face
Favicon
Git Github Gitflow
Favicon
How to create pure CSS illustrations and animate them - Part 1

Featured ones: