with the flavour of Git
1.
MacOS X
Windows
$ brew install git-flow$ wget -q -O - --no-check-certificate https://raw.github.com/petervanderdoes/gitflow-avh/develop/contrib/gitflow-installer.sh install stable | bashYou need Homebrew installed
You need Cygwin installed (wget and util-linux)
2.
Start a new repository
$ git flow init
Initialized empty Git repository in ~/project/.git/
No branches exist yet. Base branches must be created now.
Branch name for production releases: [master]
Branch name for "next release" development: [develop]
How to name your supporting branch prefixes?
Feature branches? [feature/]
Release branches? [release/]
Hotfix branches? [hotfix/]
Support branches? [support/]
Version tag prefix? []$ git flow initIt should ask some questions
Where we are now?
It moved us to develop branch
But do not worry, we are going to see all branches types in a momentÂ
3.
We have 2 types of branches: main and temporary
WTF means that?
Which are the main difference between main and temporary?
their job
We have three main:
release, develop and master
Develop comes from master
But release comes from develop
And two temporary:
hotfix and feature
Feature comes from develop
Instead, hotfix comes from master
4.
# For feature and hotfix
$ git flow [feature | hotfix] start [branch-name]
# For release only
$ git flow release start [release-number]We use start for tell git-flow that we want a new branch of the specified type
5.
We use finish for tell git-flow that we finished the job in that branch
# For feature and hotfix
$ git flow [feature | hotfix] finish [branch-name]
# For release only
$ git flow release finish [release-number]Extras
A good commit is:
Like this
We have awesome commands from git
Like git stash
# Returns to a clean working directory
$ git stash
# List all
$ git stash list
# Delete one ( the stash in pos 0 )
$ git stash drop stash@{0}
# Delete last and get it back
$ git stash pop
# Reply the same status as it was ( unstaged and ready )
$ git stash apply
# Remove all saved
$ git stash clearFor save our uncommited changes and change to another branch without uploading anything
# Change the last commit message
$ git commit --amend
# We can change the files too if we
# edit the files and call the commandOr commit
with special flags
# We can search a commit by it's content
$ git show ":/fix"
# This will show us all the commits which contains "fix"Or show
For search for a commit content
Go and try yourself!
After this presentation...