0
0
Gitdevops~10 mins

Repository (committed history) in Git - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the command to show the commit history in Git.

Git
git [1]
Drag options to blanks, or click blank then click option'
Apush
Bclone
Clog
Dstatus
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'git status' which shows current changes, not history.
Using 'git push' which sends commits to a remote repository.
2fill in blank
medium

Complete the command to show a one-line summary of each commit in the history.

Git
git log --[1]
Drag options to blanks, or click blank then click option'
Aoneline
Bpatch
Cstat
Dgraph
Attempts:
3 left
💡 Hint
Common Mistakes
Using '--patch' which shows code changes, not summaries.
Using '--stat' which shows file changes statistics.
3fill in blank
hard

Fix the error in the command to show the last 3 commits in the history.

Git
git log -[1] 3
Drag options to blanks, or click blank then click option'
Al
Bn
Cc
Dm
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-l' which is not a valid option for limiting commits.
Using '-c' or '-m' which have different meanings.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that maps commit hashes to their messages for commits with messages longer than 10 characters.

Git
{commit.[1]: commit.[2] for commit in commits if len(commit.message) > 10}
Drag options to blanks, or click blank then click option'
Ahexsha
Bauthor
Cmessage
Ddate
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'author' or 'date' instead of hash or message.
Confusing message with author name.
5fill in blank
hard

Fill all three blanks to filter commits with messages containing 'fix' and create a dictionary of commit hashes to authors.

Git
{commit.[1]: commit.[2] for commit in commits if 'fix' in commit.[3].lower()}
Drag options to blanks, or click blank then click option'
Ahexsha
Bauthor
Cmessage
Dcommitter
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'committer' instead of 'author' for the second blank.
Checking 'fix' in author or committer instead of message.