def init(path = Dir.pwd, options = {})
      exit_status = FalkorLib::Git.init(path, options)
      unless command?('git-flow')
        # Check (mainly for Linux) if the command is not available under `/usr/lib/git-core`
        git_lib = '/usr/lib/git-core/'
        error "you shall install git-flow: see https://github.com/nvie/gitflow/wiki/Installation" unless File.exist?(File.join(git_lib, 'git-flow'))
      end
      remotes      = FalkorLib::Git.remotes(path)
      git_root_dir = FalkorLib::Git.rootdir( path )
      Dir.chdir( git_root_dir ) do
        unless FalkorLib::Git.commits?( git_root_dir)
          warn "Not yet any commit detected in this repository."
          readme = 'README.md'
          unless File.exist?( readme )
            answer = ask(cyan("=> initialize a commit with an [empty] #{readme} file (Y|n)?"), 'Yes')
            exit 0 if answer =~ /n.*/i
            FileUtils.touch(readme)
          end
          FalkorLib::Git.add(readme, "Initiate the repository with a '#{readme}' file")
        end
        branches = FalkorLib::Git.list_branch(path)
        gitflow_branches = FalkorLib.config.gitflow[:branches].clone
        # correct eventually the considered branch from the options
        gitflow_branches.each do |t, _b|
          gitflow_branches[t] = options[t.to_sym] if options[t.to_sym]
          confs = FalkorLib::Git.config('gitflow*', path, :hash => true)
          gitflow_branches[t] = confs["gitflow.branch.#{t}"] unless confs.empty?
        end
        if options[:interactive]
          gitflow_branches[:master]  = ask("=> branch name for production releases", gitflow_branches[:master])
          gitflow_branches[:develop] = ask("=> branch name for development commits", gitflow_branches[:develop])
        end
        ap gitflow_branches if options[:debug]
        if remotes.include?( 'origin' )
          info "=> configure remote (tracked) branches"
          exit_status = FalkorLib::Git.fetch(path)
          gitflow_branches.each do |_type, branch|
            if branches.include? "remotes/origin/#{branch}"
              exit_status = FalkorLib::Git.grab(branch, path)
            else
              unless branches.include? branch
                info "=> creating the branch '#{branch}'"
                FalkorLib::Git.create_branch( branch, path )
              end
              exit_status = FalkorLib::Git.publish(branch, path )
            end
          end
        else
          gitflow_branches.each do |_type, branch|
            unless branches.include? branch
              info " => creating the branch '#{branch}'"
              exit_status = FalkorLib::Git.create_branch( branch, path )
            end
          end
        end
        #info "initialize git flow configs"
        gitflow_branches.each do |t, branch|
          exit_status = execute "git config gitflow.branch.#{t} #{branch}"
        end
        FalkorLib.config.gitflow[:prefix].each do |t, prefix|
          exit_status = execute "git config gitflow.prefix.#{t} #{prefix}"
        end
        devel_branch = gitflow_branches[:develop]
        #info "checkout to the main development branch '#{devel_branch}'"
        exit_status = run %(
                   git checkout #{devel_branch}
                )
        # git config branch.$(git rev-parse --abbrev-ref HEAD).mergeoptions --no-edit for the develop branch
        exit_status = execute "git config branch.#{devel_branch}.mergeoptions --no-edit"
        if branches.include?('master') && !gitflow_branches.values.include?( 'master' )
          warn "Your git-flow confuguration does not hold the 'master' branch any more"
          warn "You probably want to get rid of it asap by running 'git branch -d master'"
        end
        if devel_branch != 'master' &&
           remotes.include?( 'origin' ) &&
           branches.include?( 'remotes/origin/master')
          warn "You might want to change the remote default branch to point to '#{devel_branch}"
          puts "=> On github: Settings > Default Branch > #{devel_branch}"
          puts "=> On the remote bare Git repository: 'git symbolic-ref HEAD refs/head/#{devel_branch}'"
        end
      end
      exit_status
    end
def init(path = Dir.pwd, options = {})
      exit_status = FalkorLib::Git.init(path, options)
      unless command?('git-flow')
        # Check (mainly for Linux) if the command is not available under `/usr/lib/git-core`
        git_lib = '/usr/lib/git-core/'
        error "you shall install git-flow: see https://github.com/nvie/gitflow/wiki/Installation" unless File.exist?(File.join(git_lib, 'git-flow'))
      end
      remotes      = FalkorLib::Git.remotes(path)
      git_root_dir = FalkorLib::Git.rootdir( path )
      Dir.chdir( git_root_dir ) do
        unless FalkorLib::Git.commits?( git_root_dir)
          warn "Not yet any commit detected in this repository."
          readme = 'README.md'
          unless File.exist?( readme )
            answer = ask(cyan("=> initialize a commit with an [empty] #{readme} file (Y|n)?"), 'Yes')
            exit 0 if answer =~ /n.*/i
            FileUtils.touch(readme)
          end
          FalkorLib::Git.add(readme, "Initiate the repository with a '#{readme}' file")
        end
        branches = FalkorLib::Git.list_branch(path)
        gitflow_branches = FalkorLib.config.gitflow[:branches].clone
        # correct eventually the considered branch from the options
        gitflow_branches.each do |t, _b|
          gitflow_branches[t] = options[t.to_sym] if options[t.to_sym]
          confs = FalkorLib::Git.config('gitflow*', path, :hash => true)
          gitflow_branches[t] = confs["gitflow.branch.#{t}"] unless confs.empty?
        end
        if options[:interactive]
          gitflow_branches[:master]  = ask("=> branch name for production releases", gitflow_branches[:master])
          gitflow_branches[:develop] = ask("=> branch name for development commits", gitflow_branches[:develop])
        end
        ap gitflow_branches if options[:debug]
        if remotes.include?( 'origin' )
          info "=> configure remote (tracked) branches"
          exit_status = FalkorLib::Git.fetch(path)
          gitflow_branches.each do |_type, branch|
            if branches.include? "remotes/origin/#{branch}"
              exit_status = FalkorLib::Git.grab(branch, path)
            else
              unless branches.include? branch
                info "=> creating the branch '#{branch}'"
                FalkorLib::Git.create_branch( branch, path )
              end
              exit_status = FalkorLib::Git.publish(branch, path )
            end
          end
        else
          gitflow_branches.each do |_type, branch|
            unless branches.include? branch
              info " => creating the branch '#{branch}'"
              exit_status = FalkorLib::Git.create_branch( branch, path )
            end
          end
        end
        #info "initialize git flow configs"
        gitflow_branches.each do |t, branch|
          exit_status = execute "git config gitflow.branch.#{t} #{branch}"
        end
        FalkorLib.config.gitflow[:prefix].each do |t, prefix|
          exit_status = execute "git config gitflow.prefix.#{t} #{prefix}"
        end
        devel_branch = gitflow_branches[:develop]
        #info "checkout to the main development branch '#{devel_branch}'"
        exit_status = run %(
                   git checkout #{devel_branch}
                )
        # git config branch.$(git rev-parse --abbrev-ref HEAD).mergeoptions --no-edit for the develop branch
        exit_status = execute "git config branch.#{devel_branch}.mergeoptions --no-edit"
        if branches.include?('master') && !gitflow_branches.values.include?( 'master' )
          warn "Your git-flow confuguration does not hold the 'master' branch any more"
          warn "You probably want to get rid of it asap by running 'git branch -d master'"
        end
        if devel_branch != 'master' &&
           remotes.include?( 'origin' ) &&
           branches.include?( 'remotes/origin/master')
          warn "You might want to change the remote default branch to point to '#{devel_branch}"
          puts "=> On github: Settings > Default Branch > #{devel_branch}"
          puts "=> On the remote bare Git repository: 'git symbolic-ref HEAD refs/head/#{devel_branch}'"
        end
      end
      exit_status
    end
init?
 Initialize a git-flow repository
 Supported options:
 :interactive [boolean] confirm Gitflow branch names
 :master  [string] Branch name for production releases
 :develop [string] Branch name for development commits