Git & Git Hub Flashcards
What is Git
A command line version control tool
What is a commit
A snapshot of a repository at some point in time. Ideally, each commit contains an isolated, complete change. This makes it easy to revert your changes if you decide to take a different approach. For example, if you want to rename a variable and add some tests, put the variable rename in one commit and the tests in another commit.
What is a repository
A collection of files and directories that git can manage
What is a branch
An isolated timeline of commits. By creating a branch, you create a space to work without affecting the default (or main) branch. Additionally, you give collaborators a chance to review your work.
What is a pull
Download one or more commits from GitHub
What does the git status
command do?
It prints the current branch you are working on and lets you know if there are any changes made to that branch that are not committed to the origin/master branch.
How do you switch between different branches?
The command git switch <name of branch>
What does the command git pull origin <master or main>
do?
Synchronize your local master or main branch with your remote master or main branch (on GitHub). If you have any recently merged work on GitHub, it will be downloaded now.
How do you make a new branch?
The command git branch <name-of-branch>
How do you view all the branches in your current working directory?
The command git branch --list
What is a push?
After you make a commit, you push that commit and all associated changes to your working branch. Commuting and pushing your changes backs up your work to remote storage. This means that you can access your work from any device. It also means that your collaborators can see your work, answer questions, and make suggestions or contributions.
What is a pull request?
A request to collaborators for feedback on your changes.
When you create a pull request, include a summary of the changes and what problem they solve. You can include images, links, and tables to help convey this information.
What does a merge do?
This will automatically integrate the changes made in your approved pull request on your head branch to your base or default (main or master) branch.
What are the steps in Github Flow?
GitHub flow is a lightweight, branch-based workflow.
1. Create a branch
2. Make, commit, and push your changes
3. Create a pull request
4. Address feedback and review comments
5. Merge your pull request
6. Delete your branch