Sha256: 26976b2d9cd1239d5015d887067fa60bb967322a6ddc9244718022fb01abb467

Contents?: true

Size: 941 Bytes

Versions: 1

Compression:

Stored size: 941 Bytes

Contents

difficulty 4
description "You have committed several times but would like all those changes to be one commit."

setup do
  repo.init
  FileUtils.touch(".hidden")
  repo.add(".hidden")
  repo.commit_all("Initial Commit")
  system "git branch -m master"
  FileUtils.touch("README")
  repo.add("README")
  repo.commit_all("Adding README")
  File.open("README", 'w') { |f| f.write("hey there") }
  repo.add("README")
  repo.commit_all("Updating README (squash this commit into Adding README)")
  File.open("README", 'a') { |f| f.write("\nAdding some more text") }
  repo.add("README")
  repo.commit_all("Updating README (squash this commit into Adding README)")
  File.open("README", 'a') { |f| f.write("\neven more text") }
  repo.add("README")
  repo.commit_all("Updating README (squash this commit into Adding README)")
end

solution do
  repo.commits.length == 2
end

hint do
  puts "Take a look at the `-i` flag of the rebase command."
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
githug-0.5.1 levels/squash.rb