Git & Git Hub Flashcards

1
Q

What is Git

A

A command line version control tool

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a commit

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a repository

A

A collection of files and directories that git can manage

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a branch

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a pull

A

Download one or more commits from GitHub

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What does the git status command do?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do you switch between different branches?

A

The command git switch <name of branch>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does the command git pull origin <master or main> do?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How do you make a new branch?

A

The command git branch <name-of-branch>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How do you view all the branches in your current working directory?

A

The command git branch --list

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is a push?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is a pull request?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What does a merge do?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are the steps in Github Flow?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly