Other Pages

add_the_project_to_a_git_repo.step

goals do
  goal "Add all our files to the git repository"

  message "In order to publish our application, we need to add our application and any changes we make over time to a \"revision control system\". Rails already set up *git* for us."
end

steps do

  step do
    console "git status"

    message "`git status` tells you everything git sees as modified, new, or missing."
    message "Right now there is a long list of folders and files shown in red. We need to add them to the git repository"
  end

  step do
    console "git add -A"

    message "`git add -A` will prepare all the files in the current folder for the next step."
    message ""

  end

  step do
    console "git commit -m 'new rails project'"

    message "`git commit` will take a snapshot of the current files and add them to the repository. It will include a message."
    message ""

  end

  step do
    console "git log"

    message "`git log` shows you everything that happend until now."
    message "You will see one entry in the log, the initial commit."

    img src: "img/git_log_initial.png", alt: "git log showing inital commit"

  end

  step do
    console "git status"

    message "Now you should see something like `nothing to commit, working directory clean` which means you've committed all of your changes."
  end
end

explanation do
  message <<-MARKDOWN
By checking your application into git now, you're creating a record of your starting point.

Whenever you make a change to this project, you will add it to git before moving on.

This way, if anything ever breaks, or you make a change you don't like, you can use git as an all-powerful "undo" technique.
But that only works when you remember to commit early and often!
  MARKDOWN
end

next_step "running_your_application_locally"