3. IGNORING FILES Flashcards

1
Q

Ignoring files

A

Git is great at tracking files, but you don’t always have to track everything. You could have some files with some passwords or other sensitive information that you don’t want to share with others, that could be authentication, tokens, API keys, et cetera.

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

¿What happens with Ignored files?

A

Ignored files aren’t uploaded to GitHub, so this is a great way to add notes that you don’t need to share with others, so for example, a great place to keep to-do items.

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

¿How to add ignored files?

A

To take care of ignoring files, you can create a .gitignore file at the root level of your project. And inside that file, you can add any type of file or patterns that you want to ignore.

EX: you can add an entry for the DS_Store file, as well as the vscode/ folder. Notice that the folder has a slash at the end. If your project requires it, you can add a file here, like authentication.js to store any tokens, API keys, et cetera. Another common file is called node_modules. You can also add a notes folder for local notes about the project that you don’t want to share, or you can create a special extension and add the notes anywhere in your project.

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

GIT AND EMPY FOLDERS

A

By the way, Git doesn’t track empty folders, so you don’t have to worry about those.

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

¿What is .MD file format?

A

MARKDOWN file extension. MD files are saved in plain text format that uses Markdown language which also includes inline text symbols, defining how a text can be formatted such as indentations, table formatting, fonts, and headers. MD files can be converted to HTML with a program called Markdown.

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

GIT RM COMMAND

A

Usage: git rm [file]
This command deletes the file from your working directory and stages the deletion.

Ex: If you add something to the gitignore file after you’ve done a lot of commits, sometimes the way that Git caches information locally will get a little bit dirty. So in order to clear that you can issue this command, git rm -r, and then use the cached option with a period for the current folder, and it’ll delete all of the files that are cached recursively. You may have to do another add and a commit, but this will clear out your cache and your gitignore should work after that.

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

NOTE ABOUT GITINGNORE

A

It’s a good idea to work with the gitignore file at the very beginning of when you’re setting things up.

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