Git Flashcards

1
Q

git init

A

initialize a new Git repo

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

git status

A

find out the current state of the repo

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

git commit

A

take a snapshot of the repo at a certain time

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

git add

A

stage new or changed files

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

git diff

A

see what has changed in a repo since the last commit

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

git reset

A

reset repo to a prior stat

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

git checkout

A

look at the prior state of the repo and switch branches

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

git branch

A

create a new branch

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

git merge

A

merges branches

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

git checkout -b

A

create and go to a new branch

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

git branch -a

A

get a list of all the branches in the local repo

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

git branch -D

A

delete a branch

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

git commit -a

A
  • a switch with the ‘commit’ command to automatically:
    1. “add” changes from all known files (i.e. all files that are already listed in the index)
      1. automatically “rm” files in the index that have been removed from the working tree
      2. perform the actual commit;
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

git commit -m

A

commit and add comment ‘COMMENT’

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

git log

A

shows the commit logs

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

git merge –no-ff

A

merges the branch to the master and keeps the merge history

17
Q

git merge

A

merges the branch to the master

18
Q

git add .

A

adds (stages) all the files in the current directory

19
Q

echo “console.log(‘foo’)”&raquo_space; foo.js

A

create a new file called foo.js in the current directory, with the single JavaScript command console.log(‘foo’) in it.

20
Q

HEAD

A

a variable that points to a commit