Sha256: 178e6138dd6d8f105fc7f75fb894987f900d78df6ffde1f5b28c8a707fefef4e

Contents?: true

Size: 628 Bytes

Versions: 12

Compression:

Stored size: 628 Bytes

Contents

difficulty 3

description "A file has been modified, but you don't want to keep the files.  Checkout the `config.rb` file from the last commit."

setup do
  repo.init
  File.open("config.rb", "w") do |file|
    file.puts("This is the initial config file")
  end

  repo.add("config.rb")
  repo.commit_all("Added initial config file")

  File.open("config.rb", "a") do |file|
    file.puts("These are changed you don't want to keep!")
  end
end

solution do
  repo.status.files["config.rb"].type != "M" && repo.commits.length == 2
end

hint do
  puts "You will need to do some research on the checkout command for this one."
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
githug-0.2.2 levels/checkout_file.rb
githug-0.2.1 levels/checkout_file.rb
githug-0.2.0 levels/checkout_file.rb
githug-0.1.8 levels/checkout_file.rb
githug-0.1.7 levels/checkout_file.rb
githug-0.1.6 levels/checkout_file.rb
githug-0.1.5 levels/checkout_file.rb
githug-0.1.4 levels/checkout_file.rb
githug-0.1.3 levels/checkout_file.rb
githug-0.1.2 levels/checkout_file.rb
githug-0.1.1 levels/checkout_file.rb
githug-0.1.0 levels/checkout_file.rb