Git Cheat Sheet: Essential Commands for Developers
11 Questions
0 Views

Git Cheat Sheet: Essential Commands for Developers

Created by
@NourishingNonagon

Podcast Beta

Play an AI-generated podcast conversation about this lesson

Questions and Answers

How can you view the list of modified files in Git history?

  • git log --grep='GUI'
  • git log --before='2020-08-17'
  • git log --stat (correct)
  • git log -3
  • Which command should you use to remove all untracked files in a Git repository?

  • git stash clear
  • git clean -fd (correct)
  • git branch bugfix
  • git checkout master
  • What is the Git command to tag the last commit as 'v1.0'?

  • git tag -d v1.0
  • git tag v1.0 (correct)
  • git tag v1.0 5e7a828
  • git tag
  • How do you show the author of each line in a specific file in Git?

    <p>git blame file.txt</p> Signup and view all the answers

    Which Git command allows you to create a merge commit even if Fast Forward is possible?

    <p>git merge --no-ff bugfix</p> Signup and view all the answers

    How can you view remote tracking branches in Git?

    <p>git branch -r</p> Signup and view all the answers

    'git stash push -m 'New tax rules'' is used for what purpose in Git?

    <p>Creating a new stash with a message</p> Signup and view all the answers

    'git bisect reset' is used for what purpose?

    <p>Terminates the bisect session</p> Signup and view all the answers

    'git restore --source=HEAD~2 file.js' is used for what purpose?

    <p>Restoring an earlier version of file.js from two commits ago</p> Signup and view all the answers

    Which Git command is used to apply the changes from a specific stash to the working directory?

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

    How can you delete all stashes in a Git repository?

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

    More Like This

    Git Commands and Tagging Quiz
    5 questions
    Git Alapok Quiz
    5 questions

    Git Alapok Quiz

    FrugalYtterbium avatar
    FrugalYtterbium
    Use Quizgecko on...
    Browser
    Browser