Git Flashcards

1
Q

3 parts of a Git project

A
  • Working Directory
  • Staging Area
  • Repository
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How to: View status

A

git status

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

How to: Add files to staging area (multiple)

A

git add

or multiple: git add

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

How to: View changes

A

git diff

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

How to: Start a new project

A

git init

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

How to: Save changes from the staging area

A

git commit -m””

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

How to: View commit history

A

git log

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

What is the HEAD commit?

What does git show HEAD do?

A

The commit you are currently on

Shows the log info for the current commit and the changes that were committed

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

How to: View the current commit

A

git show HEAD

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

How to: Restore to last commit

A

git checkout HEAD

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

What does git checkout HEAD do?

A

Rolls back (unstages) file changes in the staging area to last commit but does not discard changes from the working direcory

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