Version control systems like Git allow developers to track changes to source code over time. Git is a distributed version control system that stores the entire history of a project locally, including all file versions and commits. Users interact with Git through either a graphical user interface or command line interface. Common commands include git add to stage files, git commit to save changes to the local repository, and git push to sync changes with a remote repository. Branching allows developers to work independently on different features before merging them together.
Version control systems like Git allow developers to track changes to source code over time. Git is a distributed version control system that stores the entire history of a project locally, including all file versions and commits. Users interact with Git through either a graphical user interface or command line interface. Common commands include git add to stage files, git commit to save changes to the local repository, and git push to sync changes with a remote repository. Branching allows developers to work independently on different features before merging them together.
1. Version control systems are often used to manage the source
code for development projects so they are also sometimes referred to as a _____. source code manager 2. Why would using a hosting service for version control systems (e.g. Bitbucket, Github) be more beneficial than a cloud service (e.g. Dropbox, Google Drive) VCS hosting services include extra features beyond just file syncing such as issue tracking, collaborations tools and wikis. 3. Why are commits an essential part of using Git? Commits are used to track the changes in a Git repository. The version history consists of a series of commits. 4. How is a centralized VCS different from a distributed VCS? Centralized: All project files and the version history must be stored on a remote central server. Distributed: The entire directory of project files and version history can be stored locally or remotely. 5. Which type of VCS model does Git belong to? Distributed Version Control 6. What is the difference between using a GUI and the command line to perform different actions? GUI: Uses icons, menus, buttons and other graphical representations to perform actions. Command line: Uses text- based commands to execute the action. 7. In computing, the operating system's interface is referred to as the _____. Shell 8. The working directory is where you _____. The staging area stores the _____. The repository contains the _____, which create the version history. make edits; list of revisions; commits 9. When saving a file with Git, what two steps are required? First add the file, then commit it. 10. When adding modified files to the repository, what commands are used and in what order? Use git add to move the modified files from your working directory to the staging area. Then git commit the add the files to the repo. 11. After creating a remote repository in your Git hosting account, how do you create a local copy of the remote repo? Use git clone with the remote repo URL. 12. Which of the following commands will set the username for all your repositories. git config --global user.name "Your Username" 13. In the command ls -a, what does the -a represent? An argument, used to run different options such as listing all files, including hidden files. 14. What is command used for creating a local Git repository? git init 15. What are the two commands used to keep a local and remote repository in sync and how are they used? git push is used to upload the local commits into the remote repository. git pull is used download the commits from the remote repository, and merge the changes into the local repository. 16. The git status command can be used to show: A. what branch you're on B. whether the local and remote repos have the same number of commits C. a list of modified and unmodified files D. which files have been staged A, B, D 17. Which command is used to navigate to different directories? Cd 18. If you delete the local repository, will the remote repository be deleted as well? FALSE 19. If you wanted to push the commits from your local master branch to your remote master branch, what would the command look like? git push origin master 20. Which of the following is a benefit for using command line over a GUI? All Git commands can be executed using the command line. With a GUI, the features will vary. 21. What does "checkout" mean in the context of using Git branches? To checkout a branch is to switch to that branch's working directory. 22. How are the branches that you create different from the default master branch? Git makes no technical distinction between the master branch and other branches. 23. When should a feature branch be merged into the designated central branch (usually the master branch)? Once the modified files have been tested, added, committed and deemed ready to be included as part of the latest codebase. 24. When you make a commit in a branch, where is the commit initially stored? In the revision history of that branch. 25. When deleting a branch, what does "Force delete" mean? The branch will be deleted, even if it hasn't been merged or has outstanding commits that haven't been pushed.