Git Flashcards

1
Q

What is Git?

A

Git is a distributed version control system used to track changes in source code during software development.

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

True or False: Git is a centralized version control system.

A

False

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

What command is used to create a new Git repository?

A

git init

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

Fill in the blank: The command to stage changes in Git is _____.

A

git add

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

What command is used to commit changes in Git?

A

git commit

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

What is the purpose of the .gitignore file?

A

To specify files and directories that Git should ignore.

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

What command do you use to check the status of your Git repository?

A

git status

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

True or False: A branch in Git is a separate line of development.

A

True

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

What command is used to create a new branch?

A

git branch [branch-name]

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

What is the command to switch branches?

A

git checkout [branch-name]

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

What does the command ‘git merge’ do?

A

It combines changes from different branches into one branch.

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

Fill in the blank: The command to view the commit history is _____.

A

git log

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

What is a remote repository?

A

A remote repository is a version of your project that is hosted on the internet or another network.

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

What command is used to clone a remote repository?

A

git clone [repository-url]

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

True or False: You can only push changes to a remote repository if you have write access.

A

True

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

What command is used to push changes to a remote repository?

17
Q

What command is used to pull changes from a remote repository?

18
Q

What is a commit hash?

A

A unique identifier for a specific commit in the Git history.

19
Q

What does ‘git fetch’ do?

A

It retrieves updates from a remote repository without merging them.

20
Q

Fill in the blank: In Git, a ‘fork’ is a copy of a repository that allows you to freely experiment without affecting the original project.

21
Q

What is the purpose of tags in Git?

A

Tags are used to mark specific points in history as important, often for release versions.

22
Q

What command is used to create a tag?

A

git tag [tag-name]

23
Q

True or False: Git allows you to revert to a previous commit.

24
Q

What command is used to revert a commit?

A

git revert [commit-hash]

25
What is a pull request?
A pull request is a way to propose changes to a codebase and request that someone reviews and merges those changes.
26
What does 'git stash' do?
It temporarily saves changes that are not ready to be committed.