Git & Git Hub Flashcards
What is a version control system?
A system that tracks the differences between versions of files, typically used in software development.
What popular method is used to track software versions?
Version control technologies like Git and GitHub.
What is Git?
Git is a version control system designed to help users keep track of changes to files within their projects.
Who designed Git and why?
Linus Torvalds designed Git to manage changes to the Linux kernel, which has thousands of contributors.
What are some benefits of Git over other version control systems?
Git offers better speed, performance, reliability, free and open-source access, and an accessible syntax.
What is GitHub?
GitHub is a Cloud-based hosting service that lets you manage Git repositories from a user interface.
What is a Git repository?
A Git repository is used to track all changes to files in a specific folder and keep a history of those changes.
What additional features does GitHub provide beyond Git?
GitHub provides features like access control, pull requests, automation, documentation, ticketing, and project management.
How is GitHub like a social network?
GitHub users have profiles, can follow other users, and contribute to public projects from anywhere in the world.
What do you do after choosing the owner of the repository?
Input a repository name.
What file is often initialized with a new repository?
A README.md file.
What is a README.md file?
A markdown file used for documentation, which is shorthand for creating HTML pages.
What is the main branch in a Git repository?
The main branch is the default branch of the repository, also known as the main line.
What does the ‘Go to file’ button do in GitHub?
It allows users to view and access the files in the repository.
What command is used to clone a repository using HTTPS?
git clone followed by the HTTPS URL.
What command is used to list directories and hidden files in the terminal?
ls -la.
What is the .git directory?
A hidden folder that contains Git-related information for source control.
What is GitHub?
A cloud-based hosting service that lets you manage Git repositories from a user interface.
What command is used to navigate into a directory in the terminal?
cd followed by the directory name.
What does the command ‘ls -la’ do?
It lists all files and folders, including hidden ones.
What is the .git folder?
A hidden folder used to track all changes in a Git repository.
What are the three states in the Git workflow?
The three states are modified, staged, and committed.
What does it mean when a file is in the modified state?
The file has been changed but is not yet tracked by Git.
What is the staged state in Git?
The file is added to the staging area, where changes are tracked before being committed.
What does it mean when a file is in the committed state?
The file has been saved and a snapshot of the current changes has been taken.
What is the purpose of committing a file in Git?
To save the file and create a snapshot of the current changes.
What does the Git workflow involve?
A file is added from the working directory to the staging area, committed, and pushed to the remote repository.
What can be done after pushing a file to a remote repository?
The file can be fetched, checked out, or merged to a working directory.
What does the pwd command do?
It prints the working directory, showing the current directory location.
What does the git status command show?
It displays the current branch, the status of the working directory, and any changes to commit.
What is the purpose of the git add command?
To track new or modified files, adding them to the staging area for the next commit.
What does the touch command do?
It creates a new empty file, like test.txt.
What happens after running git add on a file?
The file moves to the staged state, ready to be committed.
What is the git restore command used for?
It can be used to unstage changes or restore files to their previous state.
What does the clear command do in the terminal?
It clears the terminal screen, making it easier to read.
What does the git commit -m command do?
It commits the staged changes with a message attached, describing the changes.
What is the purpose of the git push command?
To upload the local commits to the remote repository on GitHub.
What does the message ‘nothing to commit, working tree clean’ mean?
It means there are no changes to commit, and the working directory matches the repository.
What command is used to create a new branch and switch to it in Git?
git checkout -b followed by the branch name.