Git Flashcards

1
Q

What is the command to initialize a new Git repository?

A

git init

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

What is the purpose of .gitignore?

A

Specifies which files and directories should be ignored (not tracked or included in version control) by git.

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

What does git pull do?

A

It pulls the latest changes from the remote repository and merges then into your local branch.

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

What does git fetch do?

A

Retrieves the latest changes from the remote repository but does not merge them into your local branch. Changes can be revived before merging.

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

What is the command to create a new branch?

A

Git checkout -b name

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

What is git commit?

A

It records changes to the repository along with a message.

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

What does git add do?

A

It tells git which changes you want to include in your next commit.

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

What does git log do?

A

It displays a list of commits in the current branch.

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

What does git clone do?

A

It creates a copy of the remote repository on your local machine

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

What does git status do?

A

Displays the statebod the working directory and staging area.

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

What does git revert do?

A

Creates a new commit that undies changes from the previous commit.

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

What does git branch do?

A

It lists, creates, or deletes branches.

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

What is Git?

A

A version control and command line tool

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

What does fork do?

A

It allows you to create two branches.

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

How do you create a new repository?

A

Github.com/new

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