Command Line, Git, and GitHub Basics Flashcards

(34 cards)

1
Q

a text-based environment where you can do things like create, move, copy, and delete files and folders, using different commands that are like mini-programs.

A

The command line

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

What is used to keep track of changes in files within a project. It allows you to take snapshots of a project at different points in time, create different versions of a project, and move between and even combine those different versions.

A

Version Control ystem

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

change directory, used to move from one directory (a.k.a., folder) to another

A

cd: cd ~ = home directory ; cd .. is a shortcut for the parent directory

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

print working directory, used to print the name of the folder you’re currently in

A

pwd

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

list, used to list the contents of a directory

A

ls

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

make directory, used to create a new directory

A

mkdir. For multiple files use: mkdir -p test/cats/dogs/bears

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

used to create a new (empty) file with a given name

A

touch

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

remove, used to remove a file (or folder)

A

rm

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

remove directory, used to remove a directory

A

rmdir

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

move, used to move a file or directory

A

mv

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

copy, used to copy a file or directory

A

cp

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

list all file including hidden

A

ls -a

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

(short for conCATenate) is used to print out the contents of a file to the command line.

A

cat command ex: cat file_folder/file.txt

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

To make a file or folder hidden, all you have to do is use a _______ as the first character in the name.

A

period (.) example: touch .hidden_file.txt

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

To hide a file on Windows, you must set the file’s _____ to hidden as well.

A

attribute : This can be done in Git Bash using the attrib command. Type attrib +h plus the file path in quotations. For example:

$ attrib +h “C:\Users\benvi\test.hidden-file.txt”

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

deleting in the command line environment is

17
Q

use ____ to get an interactive prompt that will tell you what you’re about to delete, and ask you to confirm that you really want to delete it.

18
Q

If you need to delete a directory that has files or other directories in it, you’ll need to use the rm command along with the

A

-r and -f flags. The -r flag stands for “recursive” and will attempt to remove subfolders within the target folder. The -f flag will automatically remove files in the target folder and its subfolders without asking for confirmation. You could also run rm -r folder-to-be-removed, and this will allow you to delete the folder and its contents, but you’ll be prompted along the way to confirm deletion of individual files.

19
Q

Copying a file or folder is similar to moving it, except that

A

the original is retained

20
Q

two key ideas to grasp about Git, and everything else more or less falls out from them:

A

taking snapshots of code and creating distinct branches of code.

21
Q

makes it safe to make deep (or shallow) changes to your code with less fear that you’re going to “destroy everything”.

22
Q

allow you to have different, diverging versions of a code repository.

23
Q

set up a global user name and user email for Git.

A

git config –global user.name “Beyonce Knowles”

git config –global user.email “beyonce@thinkful.com”

24
Q

used to initialize a new Git repository

25
used to find out the current state of the repository (aka, repo, for short)
git status -
26
used to stage new or changed files. We'll discuss the idea of staging changes in a moment
git add -
27
used to take a snapshot of the repo at a point in time
git commit -
28
used to see what has changed in a repo since the last commit
git diff --
29
used to reset your repository to a prior state.
git reset --
30
used to look at a prior state of the repository
git checkout --
31
Git's version control system knows about a file and is watching it
Git is tracking a file. If a tracked file has been included in a commit, Git will be able to tell us how it's changed since the last commit and the present moment.
32
like telling Git, "Hey pay attention to the (new) state of this file at this particular moment.
When you stage a change to a file
33
snapshot does not happen until you commit a set of staged changes
committing a file
34
formally request to merge one version of a repo into another. GitHub has a great UI for collaboratively discussing, reviewing, and approving pull requests.
a pull request