• 6 hours
  • Easy

Free online content available in this course.

course.header.alt.is_video

course.header.alt.is_certifying

Got it!

Last updated on 6/7/23

Make and Fix Common Mistakes

Evaluated skills

  • Correct common mistakes in GitHub
  • Question 1

    You’re in Branch1 and you’ve just added the file “File2.txt.”

    But then you change your mind, and decide you want to add the file to a new branch, BranchFile. What do you do?

    • git status 
      git branch BranchFile 
      git checkout BranchFile 
      git status apply
    • git status 
      git stash 
      git branch BranchFile 
      git checkout BranchFile 
      git status apply
    • git status 
      git stash 
      git branch BranchFile 
      git checkout BranchFile 
      git stash apply
  • Question 2

    git commit --amend -m "Test"

    This command allows you to:

    • Go back to the previous commit

    • Change the message of the previous commit

    • Create a new commit with the message “Test”

  • Question 3

    You want to go back to the previous commit and add a file to it. What do you do?

    • git commit --amend --no edit 
      git add myForgottenFile 
      git commit
    • git add myForgottenFile 
      git commit --amend --no-edit
    • git commit --amend 
      git add myForgottenFile 
      git commit
    • git add myForgottenFile
      git commit --amend
Ever considered an OpenClassrooms diploma?
  • Up to 100% of your training program funded
  • Flexible start date
  • Career-focused projects
  • Individual mentoring
Find the training program and funding option that suits you best