Git and GitHub Flashcards

1
Q

What does Git do?

A

It tracks the changes you make to files (AKA a version control system).

*you have a record of what has been done
*you can revert to specific versions
*allows changes by multiple people to all be merged into one source.

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

Three basic Git commands

A

*git init (this creates or initializes an empty git repository)

*git add xxxx adds file to the staging area. Use a . to add all files.

*git commit -m ‘x’ where x = a description of your update

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

What’s the Git command for looking at your version history?

A

git log
*This shows a repository’s history, i.e. all previous saved changes

*use when you need to find a specific version of a project

*use to figure out what changes will be introduced by merging in a feature branch.

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

What’s the git command for going into a previous version of your code?

A

git checkout x
(where x is the code from git log. This code is a ‘commit hash’)

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

What’s the difference between Git and Github?

A

Git is stored on your computer. Github is a website where you can put a git so other people can access it.

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

What is a repository in Git?

A

Another name for a folder. Nothing more.

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

What is a commit in Git?

A

*a snapshot or milestone along the timeline of a Git project.

*the core building block unit of a Git project timeline.

*created with the git commit command to capture the state of a project at that point in time.

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

What is a branch in Git?

A

an independent line of development. You have the option of merging them into the master branch or not merging them

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

What’s it called when you publish from your Git to GitHub?

A

a push. The command is:
git push origin master
or
git push origin new-branch (for publishing changes after the original is already changed?)

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

What’s it called when you download from GitHub to your local Git?

A

a pull. The command is –git pull origin master– to pull the whole thing

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

How do you create a branch in Git?

A

git checkout -b new branch

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

How do you check the status of new changes in Git?

A

git status

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