Git and GitHub Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What is the power of Git?

A

Version control, it allows us to keep track of the changes that have been made to our projects, to roll back to previous versions and current versions, and to add new features to our projects without have to change its current status.

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

What are the only two configuration values after you have installed git?

A

git config –global user.name “Your Name”
git config –global user.email your_name@example.com

to confirm: git config –global –list

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

What is the color coded output config?

A

git config –global color.ui “auto”

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

git init

A

initialize the repository

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

git add

A

add all the files that were changed since the last back up to the staging area

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

git status

A

shows you all the files that were changed since the last backup and which ones are already added to the staging area

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

git commit -m ‘…’

A

commits the changes to the repository

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

git checkout ____

A

switches to the branch name provided in your git repository. This will create a new branch if the name provided doesn’t exist.

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

git branch

A

shows all of your git branches and marks the one you are currently on

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

git log

A

shows all the backups created in the repository

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

git blame ___

A

shows who wrote which line of code or in other words who is to be blamed for that particular line of code

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

git remote add origin ___

A

tells git to add a remote place called ‘origin’ to a remote URL ____

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

git push

A

pushes the changes in your local repository to the remote repository

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

git pull

A

pulls the changes in a remote repository to your own local repository

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

git clone ___

A

clones a remote repository in ___ to your own local folder

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

In our commit log what is the number after the commit text?

A

It is the commit hash and it’s what we use to refer to a particular commit

17
Q

git diff –stat ____

A

git diff prints some statistics about the changes that have been made. Just ad the –stat option to see what changes have been made since a particular commit.

18
Q

git revert

A

reverts a commit by creating a commit in your repository that reverses all the changes made by the original commit

19
Q

Git States

A

Git has three main states that your files can reside in: committed, modified, and staged.

20
Q

Modified State

A

You have changed the file in your Working Directory but have not added it yet.

21
Q

Staged State

A

You have marked a modified file to go into the Staging Area for your next commit

22
Q

Committed

A

Data is safely stored from the Staging Area into your local .git Directory

23
Q

Add

A

Add: In Git, an add is what tells your repository, “Hey, I want you to add these changes to the next version of the project!” You add files to the staging area to have them included in your next commit (see below). If you add a file and then make more changes to it, you must re-add the file to include all of your recent changes.

git add index.html
to add a specific file, indelx.thml to the staging area
git add .
to add all changed files to the staging area

24
Q

Commit

A

Commit: Once you feel your project has reached a point where it should be saved, you tell Git to commit all your files in the staging area. This means every file you have added will be updated with the changes you have made. With every commit, you create another local version of your project. Additionally, Git clears the staging area each time you do a commit.
git commit -m ‘Name to identify commit goes here’