Git and Github Flashcards

1
Q

Git - Definition: What is a Repository?

A

A container (or folder) for a project tracked with git.

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

Git - Definition: What is a Commit?

A

checkpoints, or snapshots of the project at it’s current state - it’s a saved version of the code with a history, allowing us to go back and forth between revision

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

Git - Creating a Repository: Bash commands to navigate the directory (filepath, folder in current directory, previous directory, parent directory)

A

Access file path: cd c:/fullfilepath

Access folder in current directory: cd foldername

Access previous directory: cd -

Access parent directory: cd ..

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

Git - Creating a Repository: what does the bash command cd stand for?

A

Change Directory

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

Git - Creating A Repository: bash command making a directory

A

Within the designated directory -

mkdir [newfoldername]

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

Git - Creating A Repository: bash command making a new blank file

A

Within the designated directory -

touch [filename.filetype]

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

Git - Creating A Repository: bash command listing files in current directory

A

Within Designated directory -

ls

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

Git - Committing Files: What are the 3 stages to a commit?

A
  1. Modification - File changes
  2. Staging - Approving file changes
  3. Committing - Creating new version
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Git - Committing Files: How do you check what files have been modified or staged since the last commit?

A

Use the bash command:

git status

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

Git - Committing Files: What is staging area?

A

An area that allows approved modified files to be committed, they must first be added to the staging area. This stops unwanted files from being committed.

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

Git - Committing Files: How do you stage files?

A

Bash Commands:
Automatically add modified files: git add .

Add specific files: git add [filename]

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

Git - Committing Files: How do you unstage files - retaining the modification?

A

Use the bash command:

git reset [filename]

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

Git - Definition: What is Git?

A

The software Git is a version control system (vcs) for tracking changes in computer files

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

Git - Committing Files: How do you commit staged files?

A

Bash Command:

git commit -m “comments on the changes made”

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

Git - Committing Files: How do you check the commit history?

A

Bash Command:
full version: git log
condensed version: git log -oneline

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