Sha256: b743e37584dd1d26063bf5d6aff2a2cb9db45839213720c4bc709dd468c5e9c6

Contents?: true

Size: 1.15 KB

Versions: 4

Compression:

Stored size: 1.15 KB

Contents

desc 'Start will create a new feature branch and setup remote tracking'
long_desc <<LONGTIME
  Performs the following:\n
  \t$ git checkout <base_branch>\n
  \t$ git pull origin <base_branch>\n
  \t$ git push origin <base_branch>:refs/heads/[new_feature_branch]\n
  \t$ git checkout --track -b [new_feature_branch] origin/[new_feature_branch]\n
LONGTIME
arg_name '[new-feature-branch-name] - name of the new feature branch'
command :start do |c|
  c.flag [:b,:base], default_value: 'master'
  c.action do |global_options, options, args|
    if args.empty?
      raise "usage: git-reflow start [new-branch-name]"
    else
      # base_branch is the branch that you want to base your feature branch off of
      # This command allows you to 'git reflow start' off your base branch
      base_branch = options[:base]

      GitReflow.run_command_with_label "git checkout #{base_branch}"
      GitReflow.run_command_with_label "git pull origin #{base_branch}"
      GitReflow.run_command_with_label "git push origin #{GitReflow.current_branch}:refs/heads/#{args[0]}"
      GitReflow.run_command_with_label "git checkout --track -b #{args[0]} origin/#{args[0]}"
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
git_reflow-0.8.3 lib/git_reflow/commands/start.rb
git_reflow-0.8.2 lib/git_reflow/commands/start.rb
git_reflow-0.8.1 lib/git_reflow/commands/start.rb
git_reflow-0.8.0 lib/git_reflow/commands/start.rb