Linux Ch. 27 Controlling Versions with Git

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

2. Conceptually Git is broken up into distinct areas. Which of the following is one of those areas? (Choose all that apply.) A. Blob B. Local repository C. Remote repository D. Index E. Working directory

B, C, D, E. Conceptually Git is broken up into distinct areas, which are the working directory, the staging area (also called the index), the local repository, and the remote repository. Therefore, options B, C, D, and E are correct answers. A blob is another name for an object stored by Git in the .git/objects/ directory. Thus, option A is an incorrect choice.

5. When setting his Git configuration options, Bruce employs the --global option on his commands. What does this mean? A. The configuration information is stored on GitHub. B. The configuration information is stored in ∼/.gitconfig. C. The configuration information is stored in the working directory's .git/config file. D. The configuration information is stored in the working directory's .git/index file. E. The configuration information is stored in the working directory's .git/objects Directory.

B. Since Bruce employed the --global option when setting his Git configuration options, the information is stored in the global ~/.gitconfig file. Therefore, option B is the correct answer.

10. Tony created a new branch of the StoneTracker project called report. He has completed and tested his work. He now needs to merge it with the StoneTracker project's master branch. After switching branches to the master branch, what command should he employ? A. git merge master B. git merge report C. git rebase master D. git rebase report E. git checkout master

B. The git merge report command will merge the report branch into the master branch as desired, so option B is the correct answer.

8. Natasha has completed her open-source project, which is set to be released to the public today. She has moved the files to the staging area, committed her work to the local repository, and configured the remote repository's address. What is her next step? A. Go home and relax. She deserves it. B. Clone the remote repository to her local system. C. Push her project to the remote repository. D. Pull her project from the remote repository. E. Use the remote add origin URL command.

C. Natasha is ready to push her project to the remote repository, so option C is the correct answer.

4. Natasha has created her working directory for a new project. What should she do next to set up her Git project environment? A. Issue the mkdir command. B. Enter the git config --list command. C. Set up her GitHub repository. D. Enter the git init command. E. Start creating her program files.

D. Because Natasha is setting up her Git environment, she should next create and initialize the .git/ directory in her working directory, via the git init command. Therefore, option D is the correct answer.

7. There are 25 files in Natasha's working directory and she only wants to add 22 of them to the index. She plans on using the git add . command to be efficient. What should she do? A. Move the 3 files out of her working directory. B. Add the 22 files individually via the git add command. C. Create a new working directory for the 3 files. D. Add the 3 files' names to a .gitignore file. E. Temporarily delete the 3 files.

D. Natasha is being efficient by employing the git add . command, which will add all the files within the working directory to the staging area (index). To stay efficient, she should create a .gitignore file in the working directory and add the names of the three files that she wishes to keep out of the index to that file. This will prevent them from being added. Therefore, option D is the correct answer.

9. Which of the following commands allows you to switch to a new Git branch called testing? A. git branch testing B. git ls-tree --name-only -r testing C. git branch D. git commit -m "testing" E. git checkout testing

E. The git checkout testing command will allow you to switch to a new Git branch called testing. Thus, option E is the correct answer.

Explain how to set up your Git environment.

The git package provides the various Git tools used for VCSs. Create a working directory for each project using the mkdir command. The .git/ directory, used by both the staging area and the local repository, is initialized via the git init command. Finally, a third party, such as GitHub, can provide the remote repository to use with the various GFit tools.

Describe version Control.

Version control is a method or system that organizes various project files and protects modifications to them. A distributed VCS allows devs to work offline and independently. The Git VCS provides a working directory, staging area (index), and local repository and uses a remote repository provided by a third party. It is popular due to high performance, maintained modification history, file protection, and decentralization.

Summarize Git Branches.

A Git branch is a local repository area employed for a particular project section., such as development or project testing. By default, the main branch is called the master branch. New branches are created using the git branch branch-name command. You can view the vicarious branches available using the git branch utility, which uses an asterisk to denote the current branch. TO switch to another project branch, gout checkout branch-name is employed. After work on the branch is completed, its VCS files and project file can be merged with another branch via the git merge branch-name-to-merge command.

3. Which of the following are steps needed to set up a Git environment for the first time? (Choose all that apply.) A. Create a working directory. B. Initialize the .git/ directory in the working directory. C. Set up the local repository options. D. Add files to the staging area when ready. E. Establish the remote repository.

A, B, C, E. The steps listed in options A, B, C, and E are all involved in setting up setting up a Git environment for the first time. Adding files to the staging area is done after the environment is set up and files have been created in the working directory. Therefore, option D is the only incorrect choice.

1. Which of the following is true concerning version control? (Choose all that apply.) A. Provides a common place to merge and store files B. Requires file names to contain version numbers C. May be distributed or non-distributed D. Helps to protect files from being overwritten E. Can deal with files other than programs

A, C, D, E. Answers A, C, D, and E all contain true statements concerning version control and are therefore correct answers. Version control does not require file names to contain version numbers, and thus, option B is an incorrect choice.

6. Bruce has set up his Git environment and finished working on his new GreenMass.sh script. What should he do next? A. Add the script to the staging area. B. Issue the git init command. C. Commit the script to the local repository. D. Issue the git log command. E. Commit the script to the remote repository.

A. The next step Bruce should take is to add his new script to the staging area (index) via the git add GreenMass.sh command. Therefore, option A is the correct answer.

Detail committing with Git.

As needed, files are moved from the working directory to the staging area (index) via the git add utility. The project's workflow dictates when the programs are moved to the local directory via the git commit command and then onto the remote repository via the git push utility. If a remote developer needs the latest project files, the git pull command is employed. For new team members, who need all the project files, including modification history, the git clone command is used.


Set pelajaran terkait

19 Family-Centered Care of the Child

View Set

ADDING AND SUBTRACTING POLYNOMIALS

View Set

CFP Class 2 - Module 2 - Investment Risk & Return

View Set

Lecture 9.2: Racial Bias & Prejudice

View Set

Psychology 430 Final Exam Ch. 10-13 and community

View Set

CHAPTER 16: Regulation of Gene Expression in Bacteria

View Set

Pharmacology Final: NCLEX style practice questions

View Set

Blood Gas electrode and quality assurance

View Set

CFP Class 2 - Module 3 - Modern Portfolio Theory and Behavioral Finance

View Set

Chapter 6 Computer Science Quiz-AB

View Set