What is Git?
Git is a version control system (CVS) designed to make our life much, much easier.
By saving revisions (commits), Git allows us to browse through history and change, modify, go back or cherry pick specific files.
You can finally change history!
http://code.google.com/p/msysgit/downloads/list → Full installer for official Git for Windows
cd c:/Program Files/
git clone –recursive git://github.com/nvie/gitflow.git
Windows files explorer
browse to c:/Program Files/Git/bin/
http://ww.codeoasis.com/Downloads/git/gitflow-dependencies.zip → download and extract
windows+r → cmd (open windows command line)
dir c:/Program Files/gitflow
contrib\msygit-install.cmd “c:/program files/git/”
clone a project
git clone ssh://
git branch –track dev origin/dev → track the development branch locally.
git flow init → Press Enter for all
git checkout dev → basically we work only on develop and feature branch
git flow feature start
— work work work. — git add [files to commit]
git commit → prompts for a message. please describe.
— commit commit commit. — git flow feature finish
sharing with others
git pull → get all recent updates.
git push → share your code with others.
Git – the features
Git – definitions
commit – creating a record of a snapshot.
snapshot – manifest of what the file(s) in your project look like at a certain point in time.
branch – a light-weight and portable pointer to a commit object.
HEAD – special pointer that allows Git to recognize what branch is currently checked-out.
//Git file states:
un-tracked – a file that Git recognizes in the repository but doesn’t track.
tracked – files that Git tracks for changes and modifications.
modified – tracked file has been changed but wasn’t committed to the database
staged – modified file in its current version marked to go into the next commit snapshot
commited – file whose data is safely stored in the local database.
Git status //check the status
Git diff //Git diff shows changes that are still unchanged
Git log //check the commits history
Git checkout [branchName] //move to a specific branch
Git branch -d [branchName] //delete a specific branch
Git add [file] //staging files (new and modified)
Git commit //commit the staged changes
Git rm [file] //remove files
Git mv [file] //moves/renames and file
Git fetch //pulls down all the data from that remote project that you don’t have
Git pull //fetch from a remote repo and try to merge into the current branch
Git push //push your new data and branches to remote repository
Git work flow
origin repository – central “truth” repository. only considered to be the central one.
master branch – main branch that reflects a production-ready state.
develop branch – branch that reflects a state with the latest delivered development changes for the next release.
feature branch – used to develop new features for the upcoming or a distant future release.
feature – a small set of code that completes a sub-section of a business case.
release branch – support preparation of a new production release, for last minute dotting of i’s and crossing t’s.
hotfix branch– prepare for a new production release, albeit unplanned.
Git flow commands
//starting to work
Git flow init
Git push –set-upstream origin develop
Git push –set-upstream origin master
Git branch –track develop origin/develop
Git branch –track master origin/master
Git flow init
Git flow feature start [featureName]
Git flow feature finish [featureName]
Git flow feature publish [featureName]
Git flow feature pull [alias] [featureName]
Git flow release start [releaseName]
Git flow release finish [releaseName]
Git flow release publish [releaseName]
Git flow release pull [releaseName]
Git flow hotfix start [hotfixName]
Git flow hotfix finish [hotfixName]
By Elad Rome