Git Reference Flashcards

1
Q

What is git?

A

Git is a distributed version control system that allows you to track the changes made to a project over time.

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

How do we start tracking the changes in a new project?

A

execute the “git init” command in the root of your project directory.

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

What are the three parts of a git project?

A
  1. The working directory where you will be doing all your work.
  2. The staging area where you list all the changes you have made to the working directory.
    3.The repository where git permanently stores the changes as different versions of the project.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Command:
git status

A

git status will give three main categories of information.
1. changes made to files in the working directory but not yet staged for commit.
2. changes that have been staged and will be included in the next commit.
3. files in your working directory that are detected by git but are not being tracked.

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

Command:
git add

A

This will add the file(s) to the staging area any changes will be tracked.

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

Command:
git diff <file_name></file_name>

A

This will show the difference between the file in the working directory and the version in the staging area.

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

Command:
git commit -m “Complete first line of dialogue”

A

This is the final step in the git work flow. ‘git commit’ will permanently store the changes in the staging area to the git repository.
Note. -m adds a message describing the commit. this should be kept 50 characters and present tense.

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

Command:
git log

A

This will return a chronological list of all the commits in the current repository.

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