
Course – Version Control Quiz answers
Week 3: Working with Git
META FRONT/BACK-END/ANDROID DEVELOPER PROFESSIONAL CERTIFICATE
Complete Coursera Answers & Study Guide
Click to Enroll in Coursera Meta Front-End Professional Certificate
Working with Git INTRODUCTION
This Working with Git module will help you acquire a foundational understanding of the Git technology and how it is used in software development projects. By completing this module, you will be well on your way to earning Coursera’s Meta Developer Professional Certification.
You’ll learn how to install Git, create a local repository, create commits, create a remote repository and push commits to a remote repository. Through hands-on activities, you will gain an appreciation for the use of version control systems and source code management tools such as Git. You’ll have the opportunity to practice your skills through quizzes and assessments throughout the course.
Learning Objectives
- Outline the Git principles.
- Use a GitHub repository.
- Describe the steps in a standard GitHub workflow.
- Create branches and merge different branches and sources.
- Describe how code goes from local development to version control and then to live production.
KNOWLEDGE CHECK: GIT AND GITHUB
1. In git, the repository on your device is known as a Remote.
- True
- False (Correct)
Correct: Remotes are repositories on other devices such as servers. The repository on your device is known as the Local.
2. In git, what is the operation used to initially download a repository?
- Pull
- Clone (Correct)
- Push
Correct: The git clone operation is used to download a repository.
3. The staged area is used to prepare all your files and changes for committing.
- True (Correct)
- False
Correct: Correct! Files and changes are added to the staged area using the git add command.
4. Once a file is committed using the git commit operation, it is available on all remote repositories.
- True
- False (Correct)
Correct! The file is only committed to your local repository. It must be pushed to remote repositories after committing.
5. What of the following commands allow you to inspect your current changes before committing?
- git diff (Correct)
- git add
- git log
Correct: Correct! git diff is used to inspect changes.
6. Forking allows you to contribute to another person or organisation’s repository by creating your own copy of the repository.
- True (Correct)
- False
Correct: Forking is a common practice in open-source projects allowing for contributions from different developers.
7. Can you keep track of changes to files within projects using Git?
- Yes (Correct)
- No
Correct: That’s correct, Git is a version control system designed to help users keep track of changes to files within their projects.
8. GitHub provides you with many options for cloning a repository. With which of the following options do you need to set up SSH keys and assign them to the user accounts?
- HTTPS
- SSH (Correct)
- Github CLI
Correct: That’s correct. GitHub allows you to connect using the Secure Shell Protocol (SSH). This provides you with a secure channel over an unsecured network.
9. You are working on a project and have to share some code with a colleague. What is the correct order the code will flow in Git workflow?
- Remote repository, working directory, staging area, committed files
- Working directory, staging area, committed files, remote repository (Correct)
- working directory, committed files, staging area, remote repository
- Staging area, committed files, remote repository, working directory
Correct: That’s correct! The correct workflow is from the working directory to the staging area, then to committed files, remote repository and lastly to your colleague.
10. You’ve learned that Git works on the principles of the edit, stage, and commit pattern. But when you edit a file in your Git working directory it will not be tracked until it’s added. You can do this by using the Git commit command.
- False (Correct)
- True
Correct: That’s correct! You use the Git add command to tell Git that the file is staged to be committed and that any further changes to the file will be tracked going forward.
11. True or False
The purpose of a pull request is to obtain a peer review of changes made to the branch. In other words, to validate that the changes are correct.
- False
- True (Correct)
Correct: That’s correct! When you create a pull request you are asking the other developers to review your work and approve it to be merged with the repository.
12. You have created a new local repository called “test-repo”. Which command would you use to set the remote repository in git?
- Git pull
- Git remote (Correct)
- Git push
- Git clone
Correct: That’s correct! You would use the Git remote command to set the remote repository.
13. When you perform a Git Push command, it copies content from your local repository and then uses it to merge all of the content in the remote repository.
- False (Correct)
- True
Correct: That’s correct! When you use Git Push, Git compares a snapshot of your local repository with the remote one and only replaces the files that have been changed.
14. As part of a development team tasked to change an existing app, you have created a feature branch. Is it possible for your team members to see the changes you are currently working on?
- No
- Yes (Correct)
Correct: That’s right. The branch you created, is only visible to you. You have to commit your changes and push the accepted changes to the main server before your team members can see them.
15. Whenever a change occurs for a commit, the single hashed ID will update to be the latest commit for that working directory.
- True (Correct)
- False
Correct: That’s correct. Whenever a change occurs for a commit, the single hashed ID will update to be the latest commit for that working directory.
16. You have returned to development of your hotel booking app after some time away, and want to see the last changes you made. At which levels can you compare the differences between versions using Git diff?
Choose all that apply:
- Individual files (Correct)
- Commits (Correct)
- Branches (Correct)
- Author of changes
Correct: That’s correct! Individual files, branches, and commits can all be compared with Git diff.
Correct: That’s correct! Individual files, branches, and commits can all be compared with Git diff.
Correct: That’s correct! Individual files, branches, and commits can all be compared with Git diff.
17. You are a team leader at a software development company. You run the git blame command to see the changes on all the files for the week. What is the order in which the change information will display in each line?
- <Author><ID><Line number> <Date><Time><Content>
- <ID><Author><Date><Time><Line number><Content> (Correct)
- <ID><Author><Line number> <Date><Time><Content>
Correct: That’s correct! The order in which the change information will display in each line as follows: < ID><Author><Date><Time><Line number><Content>
SELF-REVIEW: CREATE A REPOSITORY WITH FORKING
1. In git, the default branch of a repo is called the ____________.
- Pwd (Correct)
- cd
- cat
Correct! The default branch is known as the main branch, or, master branch on older repositories.
2. What is the request to merge forked changes called?
- Push Request
- Code Request
- Pull Request (Correct)
Correct! You open a pull request to request merging of your forked changes.
3. When you clone a forked repository, what does origin refer to?
- Another developer’s repository
- The original repository
- The forked repository (Correct)
Correct! The origin will always default to the clone URL. In this case, the forked repository is the origin.
Coursera Meta Front-End Developer Professional Certificate Answers and Study Guide
Liking our content? Then don’t forget to ad us to your bookmarks so you can find us easily!
Weekly Breakdown | Meta Study Guides | Back to Top
MODULE QUIZ: WORKING WITH GIT
1. The git add command will add files and changes to the staged area.
- True (Correct)
- False
Correct! git add will add your changes to the staged area.
2. What git command will show you the current state of the local working directory?
- git status (Correct)
- git clone
- git pull
Correct! Git status will show the state of the working directory.
3. What command do you use to upload changes to a remote repository?
- git commit
- git push (Correct)
- git clone
Correct! mv is the Move command.
4. The git diff command will show the revision history of a repository.
- True
- False (Correct)
Correct: Flags allow you to specify different options available for a command.
5. Which command is used to download the latest changes from a remote repository?
- git pull (Correct)
- git push
Correct! git pull will download the latest changes.
6. You want to create a new branch named “feature”. Which of the following commands can you use?
- git branch feature (Correct)
- git checkout -b feature (Correct)
- git clone feature
Correct! This is will create the branch. You will need to use git checkout to move into the branch.
Correct! This will create the branch and move you into that branch.
7. You’re working on a clothing store application and run the git diff command on your local repository. It outputs the lines below. Which clothing item was removed as part of these changes?
1 @@ -4,8 +4,8 @@
2 * Hat
3 -* Shoes
3 +* Dress
4 * Watch
- Dress
- Watch
- Shoes (Correct)
- Hat
Correct! git pull will download the latest changes.
8. What command in git can be used to show all changes made by each developer?
- git log
- git diff
- git clone
- git blame (Correct)
Working with Git CONCLUSION
In conclusion, this module has helped you to develop a strong conceptual understanding of the Git technology and how it is used in software development projects to manage team files. You have installed Git, created a local repository, created a commit, created a remote repository and pushed commits to a remote repository.
Now that you understand the basics of using Git for version control, join Coursera now and start learning more about how to use this powerful tool!
Subscribe to our site
Get new content delivered directly to your inbox.
Quiztudy Top Courses
Popular in Coursera
- Meta Marketing Analytics Professional Certificate.
- Google Digital Marketing & E-commerce Professional Certificate.
- Google UX Design Professional Certificate.
- Meta Social Media Marketing Professional Certificate
- Google Project Management Professional Certificate
- Meta Front-End Developer Professional Certificate
Liking our content? Then, don’t forget to ad us to your BOOKMARKS so you can find us easily!