Git Flashcards

1
Q

Start tracking a folder

A

git init

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

The name of the git directory inside the current folder

A

.git

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

Check your current status

A

git status

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

Add a new file to be tracked

A

git add

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

Add all modified files to be tracked

A

git add .

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

Git will unstage its version of committed file but keep mine

A

git rm –cached

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

Command to update how git works

A

git config

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

Update username

A

git config –global user.name “Name”

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

update email

A

git config –global user.email “Email”

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

List all commits git is currently tracking

A

git log

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

Shows list of files included in the commit in git log

A

git log –stat

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

Show list of files included in git log (not stat flag)

A

git lob –name-only

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

Command for where git stores the global config file

A

cat ~/.gitconfit

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

Add all files with a certain file ending

A

git add ‘*.rb’

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

git preferred way to remove tracked file

A

git reset HEAD

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

Git will remove my copy of the file and stage the removal of its copy

17
Q

Does the opposite of whatever commit you specify. Stages the result. (w/o flag git will automatically commit the undo.)

A

git revert -n

18
Q

Continue a git revert

A

git revert –continue

19
Q

Abort a git revert

A

git revert –abort

20
Q

Lets you pull files from any previous commit even if they were later deleted or destroyed

A

git checkout

21
Q

go back to the last commit

22
Q

find every file it knows about and “overwrite” it with the last version committed

A

git reset –hard

23
Q

Git will protect you only __________. Any untracked files can be lost

A

up to the last commit

24
Q

remove a file from the untracked location

A

rm … just rm no git

25
Git takes "________" of files. When you add it to the staging area it adds that " _______" of teh file. You can continue working on the file but you have to actually add the new edits to staging area in order to be saved
snapshot
26
delete entire directory from command line
get outside of that directory. Then: rm -rf .git
27
Clone directory steps
- Go to where you want the folder located. | - git clone
28
Send new commits up to github
git push
29
You do/do not have to push up to github after every commit.
Do not
30
Pull changes from github down to your computer
git pull