Git Cheat Sheet: Essential Commands for Developers

NourishingNonagon avatar
NourishingNonagon
·
·
Download

Start Quiz

Study Flashcards

11 Questions

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

git log --stat

Which command should you use to remove all untracked files in a Git repository?

git clean -fd

What is the Git command to tag the last commit as 'v1.0'?

git tag v1.0

How do you show the author of each line in a specific file in Git?

git blame file.txt

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

git merge --no-ff bugfix

How can you view remote tracking branches in Git?

git branch -r

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

Creating a new stash with a message

'git bisect reset' is used for what purpose?

Terminates the bisect session

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

Restoring an earlier version of file.js from two commits ago

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

git stash apply 1

How can you delete all stashes in a Git repository?

' git stash clear '

Learn the essential Git commands for creating snapshots, browsing history, branching & merging, collaborating using Git & GitHub, and rewriting history. This cheat sheet is based on the Ultimate Git Mastery course by Mosh Hamedani, a software engineer with two decades of experience.

Make Your Own Quizzes and Flashcards

Convert your notes into interactive study material.

Get started for free

More Quizzes Like This

Use Quizgecko on...
Browser
Browser