Git Flashcards

1
Q

Start Git

A

git init

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

Check out what’s in the staging area

A

git status

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

Add a file to the local staging area

A

git add

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

Add all files in the the current directory to staging area

A

git add .

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

Remove a file from the staging area

A

git reset

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

Commit to git repository

A

git commit -m ‘Comments about what’s changed’

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

View history of changes

A

git log

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

Overview of history of changes

A

git log –summary

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

Add a file to a remote staging area

A

git add remote origin

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

Send a file to remote staging area and remember the parameters

A

git push -u origin master

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

Check for changes on our GitHub repository and pull down any new changes

A

git pull origin master

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

Examine changes to most recently committed file

A

git diff HEAD

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

Change files back to how they were at the last commit of a file

A

git checkout –

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

Create a new branch

A

git branch

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

Checkout a branch

A

git checkout

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

Create branch and check it out at the same time

A

git checkout -b <name

17
Q

Erase all the files

A

git rm ‘’

18
Q

Merge file changes

A

git merge

19
Q

Delete a branch that has been committed

A

git branch -d

20
Q

Delete a branch that hasn’t been committed

A

git branch -D