what we need for Git? (review)
1. Git installation in Windows2. Git Installation in Linux & Mac3. Git Bash for windows user4. Terminal for Linux & Mac User
Git and Git-bash in Windows
Installation:● Goto the link http://git-scm.com/download/win● Install and follow the steps with default settings● after installation open git-bash (start->All programs-
>git->Git Bash)● Command line window will appear.● type "git --version", it will show you the current git
version
Git-Flow in windows1. got to Git Bash 2. type "git clone --recursive git://github.com/nvie/gitflow.git"3. now close git bash.4. type "cmd" in start menu and then press Ctrl+shif+enter on Cmd
icon to open it in administrative mode. 5. goto git-flow directory like: C:\gitflow6. type "contrib/msysgit-install.cmd"7. it will install git-flow8. now open git bash again and type git-flow9. you will see list of option for git-flow
10. all done. Ready to start with git-flow
Git-Flow in Linux/Macinstalling git-flow in Linux: ===========================type "sudo apt-get install git-flow" and all done
installing git-flow in Mac:===========================brew install git-flow
SSh Key add in BitbucketWindows:
- open git-bash- Type “ssh-keygen -t rsa
"[email protected]"- Follow the steps- once generated, open the file: “cat ~/.
ssh/id_rsa.pub”- copy the content- add the key to bitbucket (manage
account -> ssh keys -> add key)- Done.
Linux/Mac:- open Terminal- Type “ssh-keygen -t rsa
"[email protected]"- Follow the steps- once generated, open the file: “cat ~/.
ssh/id_rsa.pub”- copy the content- add the key to bitbucket (manage account
-> ssh keys -> add key)- Done.
Git-Flow InitPrerequisite
- a repository needs to be a git repository
- master branch needs to be available in Bitbucket and local
Start Git-flow:- “git-flow init” command needs to
be run- it will create a ‘develop’ branch
from master branch.- push the ‘develop’ branch to
bitbucket.
Ready to use Git-flow
Git-Flow Tools
SourceTree for Mac and Windows. (picture: SourceTree)SmartSVN for Linux (non-commercial is free).
Git-Flow Master Branch
Development Branch
Feature Branch
TPOS-101
TPOS-101
TPOS-101
TPOS-101
Release Branch
release-v.1.0
release-v.2.0
Hotfix Branch
rel-1.0-hotfix-TPOS-200
rel-1.0-hotfix-TPOS-200
Git-Flow Featuregit-flow feature start TPOS-101
- start a branch from development branch
git-flow feature finished TPOS-100- merge the branch with
Development branch
git-flow feature finished -k TPOS-100- -k : will not delete the branch
after finish.
git-flow feature publish TPOS-100- push the branch to git
DEVELOPERFor any kind of JIRA ticket we will
create a Feature branch
Git-Flow Releasegit-flow release start release-v.1.0
- start a branch from development branch
git-flow release finished release-v.1.0- merge the branch with
Development branch- merge branch with master
branchgit-flow release finished -k release-v.1.0
- -k : will not delete the branch after finish.
git-flow release publish release-v.1.0- push the branch to git
RELEASE MANAGER
If Release branch has bug?1. check out release-v.1.0 in
local2. create branch using GIT
(NOT git-flow) ex: rel-v.1.0-TPOS-201
3. Fix the bug4. Merge the branch with your
local release branch release-v.1.0.
5. if ok, push the branch rel-v.1.0-TPOS-201 in Bitbucket
Next: - Create a Pull Request in
Bitbucket with release-v.1.0
Release v.1.0 Test done. Next???1. Finish the Release v.1.02. it will merge release v.1.0
branch with local develop and master branch.
3. check everything in local4. Push both branch in
Bitbucket. 5. Tag the branch for future
reference (most important)
- check everything in Master branch (http://staging.grspos.net).
- If everything works fine, make the release for production.
If Production has bug? :(
Production related bug fix is commonly known as HOTFIX
andGIT-FLOW manage it by himself
git-flow hotfix start rel-1.0-hotfix-TPOS-301
- create branch from mastergit-flow hotfix publish rel-1.0-hotfix-TPOS-301
- push the branch in Bitbucketgit-flow hotfix finish rel-1.0-hotfix-TPOS-301
- merge with develop- merge with master
Hotfix Workflow- Create hotfix branch using git-
flow- publish the hotfix branch
using git-flow publish- finish hotfix branch using git-
flow- check everything in local- once everything is working
fine, create two pull request to develop & master branch using bitbucket, like release branch.
- Release master review pull request, and merge it with master and develop.
NOTE: Don’t push Develop and master
branch from local after hotfix finish