Exercises: Git

We will use our new terminal powers to move through the Git exercises.

  1. In whichever directory you are keeping your coursework outside of javascript-projects, make a new directory called Git-Exercises using the mkdir command. You want to make sure this is outside of javascript-projects because it will cause an issue if you try and make a new Git repository inside an existing one.

    Check your solution
  2. Inside the Git-Exercises directory, initialize a new Git repository using git init.

  3. Use git branch to check the default branch name. If necessary, change the branch name to main.

  4. Add a file called exercises.txt using the touch command in the terminal.

    Check Your Solution
  5. Commit your local changes using the git commit procedures.

  6. Add "Hello World!" to the file called exercises.txt.

  7. Commit your local changes following the same steps that you used for step 5.

  8. Run the git log command. Take a screenshot of the result. Make note of what you see!

    Check your solution