Git Cheat Sheet: Essential Git Commands for Developers
10 Questions
1 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What command is used to remove all untracked files?

  • git cherry-pick dad47ed
  • git reset --hard HEAD^
  • git restore --source=HEAD~2
  • git clean -fd (correct)
  • Which command is used to view the history along with the list of modified files?

  • git log --stat (correct)
  • git log hash1..hash2
  • git log -3
  • git log --before=“2020-08-17”
  • How can you find the commits that touched a specific file?

  • git shortlog
  • git cherry-pick dad47ed
  • git blame file.txt (correct)
  • git log --pretty=format:”%an committed %H”
  • Which command is used to create and switch to a new branch?

    <p>git switch -C bugfix</p> Signup and view all the answers

    What does 'git bisect' help in finding?

    <p>Bad and good commits in a range</p> Signup and view all the answers

    Which command is used to delete all stashes?

    <p>git stash clear</p> Signup and view all the answers

    What does 'git merge --no-ff' do?

    <p>Creates a merge commit even if fast-forward is possible</p> Signup and view all the answers

    What does 'git rebase master' command do?

    <p>Changes the base of the current branch to master</p> Signup and view all the answers

    'git push origin v1.0' is used for?

    <p>'Pushing tag v1.0 to origin'</p> Signup and view all the answers

    'git remote rm upstream' is used for?

    <p>'Removing remote upstream'</p> Signup and view all the answers

    More Like This

    Use Quizgecko on...
    Browser
    Browser