Sha256: 19dde8be14ee19de3f9f3a10606c20547636cd5d2757ab0ea6b12b68fdff497b

Contents?: true

Size: 633 Bytes

Versions: 1

Compression:

Stored size: 633 Bytes

Contents

difficulty 2
description "You committed too soon. Now you want to undo the last commit, while keeping the index."

setup do
  repo.init
  FileUtils.touch("README")
  repo.add("README")
  repo.commit_all("Initial commit")
  FileUtils.touch("newfile.rb")
  repo.add("newfile.rb")
  repo.commit_all("Premature commit")
  system "git branch -m master"
end

solution do
  return false unless File.exists?("newfile.rb") && repo.status.files.keys.include?("newfile.rb")
  return false if repo.status.files["newfile.rb"].untracked || repo.commit_count > 1
  true
end

hint do
  puts "What are some options you can use with `git reset`?"
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
githug-0.5.1 levels/reset_soft.rb