No student devices needed. Know more
10 questions
How can you check your current git version?
git --v
git --version
git --option
git --current
What command lets you create a connection between a local and remote repository?
git remote add new
git remote add origin
git remote new origin
git remote origin
Describe what the following git commands do to commit history.
git reset --hard HEAD~5 (reset the current branch to the commit just before the last 5)
git merge --squash HEAD@{1} (HEAD@{1} is where the branch was just before the previous command. This command sets the state of the index to be as it would just after a merge from that commit)
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
reset the HEAD to the 5th commit in the repo, then merges to the master branch.
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?
checkout the beta branch and run git merge push-notification
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 commited to the master branch automatically.
Which of the following is true when you use the following command?
git add -A
All new files are staged
Only updated files are staged.
Files are staged in alphabetical order
all new and updated files are staged.
What will the following command print to the Terminal?
git remote -v
A list of remote repositories you are connected to
The current git version you're running
An inline editor for modifying remote repositories
The last 5 git versions you've installed.
What will happen after run the following command?
git chechout feature-user-location
git cherry-pick {12345}
The commit is being cherry picked as the new HEAD of the commit history
A commit is being copies from the feature-user-location branch to the master branch
A commit is copied from its orignal branch over to the feature-user-location-branch
The commit is being tagged for release on the feature-user-location-branch.
What does the following command do to the git repository?
git reset --soft HEAD^
Undoes the last commit in the working branch and sets the HEAD back one commit.
Keeps the HEAD at the current commit, but clears all previous commits.
Resets the working branch to the first commit.
Keeps the HEAD at the current commit, but clears all previous 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?
Use git bitsect to compare the buggy commit to an early commit that works as expected.
Run a git rebase to find the buggy commit.
use git search -diff to compare all commits in your repository history.
Manually backtrack through your commit history.
Why would the following command be used?
git rebase -I HEAD10
To list the last 10 commits and modify them with either the squash or fixup command
To run a comparative search of the last 10 commits for differences
To delete the last 10 commits and reset the HEAD
In order to locally cache the last 10 commits.
Explore all questions with a free account