Udacity lesson 4 Flashcards

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

add files from the working directory to the staging index

A

git add file_name file_name

can add more and more file names

or just . to add all the available changes

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

take files from the staging index and save them in the repository

A

git commit

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

see changes that have been made but haven’t been committed, yet

A

git diff

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

remove a staged commit from the staging area

A

git rm –cached file_name

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

how often should I make commits?

A

when you’ve modified “one thing”.

think: “What if all changes introduced in this commit were erased?”. If a commit were erased, it should only remove one thing.

if you have to use “and”, your commit message is probably doing too many changes - break the changes into separate commits

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

create an empty file on the command line

A

touch name.extension

also works in Git Bash

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

add text to file on the command line

A

echo “text” > > filename.extension

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

how to let git ignore a file in the project’s folder, so that it doesn’t commit this file?

A

create .gitignore, add the name of the file to it

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

how to let git ignore multiple files in the project?

A

add some shortened expression for all of the files into the .gitignore. rules below

if all of the 50 images are JPEG images in the “samples” folder, we could add the following line to .gitignore to have Git ignore all 50 images:

samples/*.jpg

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