Creating a Branch
- Learn how to create a local branch in a repository
Create a Branch
Let’s call our new branch ‘greet’.
Notice that the git status command reports that you are on the ‘greet’ branch.
lib/greeter.rb
class Greeter
def initialize(who)
@who = who
end
def greet
end
end
Changes for Greet: Modify the main program
lib/hello.rb
require 'greeter'
# Default is World
name = ARGV.first || "World"
puts greeter.greet
Update the Rakefile to use an external ruby process
Rakefile
#!/usr/bin/ruby -wKU
task :default => :run
task :run do
ruby '-Ilib', 'lib/hello.rb'