JavaScript isn't enabled in your browser, so this file can't be opened. Enable and reload.
Git Part-I
Sign in to Google
to save your progress.
Learn more
* Indicates required question
What files is this .gitignore programmed to leave out?
*
1 point
All files with a .swift, .txt, or metadata file extension, as well as the entire build directory
Only the build directory
All files in the build directory, as well as files ending with .txt or .metadata
Only files with .swift and .txt extensions.
Which statement is true when you use the git add -A command?
*
1 point
Only new files in the working directory are staged to the index.
All new and updated files from the working directory are staged to the index.
All files in the working directory are staged to the index in alphabetical order.
Only updated files in the working directory are staged to the index.
You find that your project has a tag and branch both named push-notifications, which causes confusion when trying to print out given reference. How can you specify which branch you want to look at?
*
1 point
use git show refs/push-notifications
use git show push-notifications
use git show head/refs/push-notifications
use git show refs/head/push-notifications
How can you display a list of files added or modified in a specific commit?
*
1 point
Find the commit in the remote repository, as that's the only place that kind of information is stored.
Use the diff-tree command with the commit hash.
Run git commit --info with the commit hash.
Access the commit stash data with git stash.
Your team lead needs a list of all commits that will be moved before you perform a rebase. Which command can you use to access that information?
*
1 point
git rebase -log
git rebase -i
git rebase -verbose
git rebase -all
What command lets you create a connection between a local and remote repository?
*
1 point
git remote add new
git remote add origin
git remote new origin
git remote origin
Which of the following is true you when you use the following command?
*
1 point
All new and updated files are staged
Files are staged in alphabetical order.
All new files are staged
Only updated files are staged
How could you squash multiple commits together without using git merge --squash?
*
1 point
Caching
You can't. git merge --squash is the only git command for that operation.
Rebasing
Reflogging
Where are files stored before they are committed to the local repository?
*
1 point
Saved files
git documents
Staging area
git cache
Looking at the following commands, describe what is happening.
*
1 point
The commit is being tagged for release on the feature-user-location branch
A commit is being copied from its original branch over to the feature-user-location branch
The commit is being cherry picked as the new HEAD of the commit history
A commit is being copied from the feature-user-location branch to the master branch
The branch is switched to the feature-user-location branch, and the specified commit is applied to the branch.
In a situation where you have several commits for a single task, what is the most efficient way to restructure your commit history?
*
1 point
Cherry pick the related commits to another branch.
Delete the task commits and recommit with a new message.
Squash the related commits together into a single coherent commit.
Stash the related commits under a new hash.
Why would you use a pre-receive hook in your remote repository?
*
1 point
You wouldn't, you would use it in the local repository
To execute a script when a remote receives a push that is triggered before any refs are updated
To fire a script after updates are made to the remote repository
To debug all commit tags and release versions
After you make changes to a local repository, you run the following command. What will this do?
*
1 point
Nothing, you can't use multiple options in the same command
Adds all new files to the staging area
Commits all new files with a message
Adds all modified files to the staging area, then commits them with a message
Describe what the following git commands do to the commit history.
*
1 point
Reset the HEAD to the 5th commit in the repo, then merges to the master branch
Reset the commit branch back before the last 5 commits, then squashes them into a single commit
Delete the last 5 commits
Merges the last 5 commits into a new branch
If you cloned an existing git repository, what would happen?
*
1 point
A new copy would overwrite the central repository
A copy of the repository would be created on your local machine
Nothing, cloning is not a supported git function
A copy of the repository would be created on the hosting platform
What commands would you use to force an overwrite of your local files with the master branch?
*
1 point
Option 1
Option 2
Option 3
Option 4
Why would the following command be used?
*
1 point
To run a comparative search of the last 10 commits for differences
To list the last 10 commits and modify them with either the squash or fixup command
To delete the last 10 commits and reset the HEAD
In order to locally cache the last 10 commits
You find a bug in your project, but can't locate where it was introduced in the commit history. How would you diagnose this problem?
*
1 point
Manually backtrack through your commit history.
Use git search -diff to compare all commits in your repository history.
Run a git rebase to find the buggy commit.
Use git bisect to compare the buggy commit to an early commit that works as expected.
What option can you use to apply git configurations across your entire git environment?
*
1 point
--all
--master
--global
--update
After checking your git status you get the following output, which shows the file beta-notes.js in the commit but also unstaged. How can this situation occur?
*
1 point
There were two copies of beta-notes.js but one was deleted
beta-notes.js was staged, then modified afterwards, creating two different versions of the file
Two copies of beta-notes.js were created, but only one is being tracked
There are two tracked copies of beta-notes.js, but one was removed from the commit
What is the operation doing given the Git commands below?
*
1 point
It runs a merge of a good commit that is discovered using a known bad commit and known good commit
It marks a commit for deletion using a known bad commit and known good commit to determine which commit introduced a bug
It defines a bad commit and resets the HEAD using a known bad commit and known good commit
It performs a binary search using a known bad commit and known good commit to determine which commit introduced a bug
What will the following command print to the Terminal?
*
1 point
A list of remote repositories and their URLs
The current git version you're running
An inline editor for modifying remote repositories
The last 5 git versions you've installed
What does the following command do to the git repository?
*
1 point
It deletes all previous commits and reset the repository history back to its initial state.
It resets the working branch to the first commit.
It keeps the HEAD at the current commit, but clears all previous commits.
It sets HEAD to the previous commit and leaves changes from the undone commit in the stage/index.
Your current project has several branches; master, beta, and push-notifications. You've just finished the notification feature in the push-notification branch, and you want to commit it to beta branch. How can you accomplish this?
*
1 point
Checkout the push-notifications branch and run git merge beta
Checkout the master branch and run git merge beta -> push-notification
Delete the push-notification branch and it will be committed to the master branch automatically
Checkout the beta branch and run git merge push-notification
How can you check your current git version?
*
1 point
git --v
git --version
git --option
git --current
Submit
Page 1 of 1
Clear form
Forms
This content is neither created nor endorsed by Google.
Report Abuse
Terms of Service
Privacy Policy
Help and feedback
Contact form owner
Help Forms improve
Report