Version Control using Git Flashcards

1
Q

What is Version Control?

A

A system that tracks changes to files over time.

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

List the benefits of using Version Control.

A
  • Enforce discipline
  • Archive versions
  • Maintain historical information
  • Enable collaboration
  • Recover from accidental deletions or edits
  • Conserve disk space
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is Git?

A

A version control system that lets you track changes to files over time.

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

What is the goal of Version Control?

A

Reproducibility and traceability.

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

What is GitHub?

A

A cloud-based platform for storing files and providing version control powered by Git.

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

What is a Git repository?

A

A directory where all files for a project are stored, including revisions and history.

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

Define commits in Git.

A

Every change or set of changes finalized in Git, identified by a unique ID (SHA-1 hash).

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

What is the staging area in Git?

A

A draft space where changes are prepared before committing.

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

What is the default branch in Git?

A

Master.

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

What does merging in Git do?

A

Combines changes from a branch back into the master branch or another branch.

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

What are remote repositories in Git?

A

Repositories that can be accessed and worked on remotely, often hosted on platforms like GitHub.

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

What does the ‘push’ command do in Git?

A

Uploads local changes to a remote repository.

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

What is the purpose of the ‘pull’ command in Git?

A

Updates the local repository with changes from a remote repository.

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

What is the difference between ‘fetch’ and ‘pull’ in Git?

A

‘Fetch’ retrieves updates without merging them; ‘pull’ retrieves and merges.

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

What does the ‘clone’ command do in Git?

A

Creates a copy of an existing Git repository, including its files and history.

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

What is conflict resolution in Git?

A

The process of manually resolving conflicts when multiple contributors modify the same code.

17
Q

What does the ‘git log’ command do?

A

Displays the history of commits, their unique IDs, and associated messages.

18
Q

Fill in the blank: A Git repository is initiated in a directory using the command _______.

19
Q

What are the three trees maintained by Git in a local repository?

A
  • Working Directory - Holds the actual version of the files
  • Index - Acts as staging area, move files using git add command
  • Local Repository - Using git commit command, updates the repository’s “head” which points to the last commit we made
20
Q

What command is used to move files into the staging area in Git?

21
Q

What is the purpose of the ‘git commit’ command?

A

To save changes into the Local Repository and update the repository’s ‘head’.

22
Q

What is the role of Git in the DevOps life cycle?

A

Facilitates version control for source code, scripts, configuration information, and libraries.

23
Q

True or False: Git is only useful for developers.

24
Q

What is a feature flag in the context of DevOps?

A

A technique to enable or disable features in a production environment without deploying new code.

25
Q

What is CI/CD?

A

Continuous Integration/Continuous Deployment, a practice that automates software delivery.

26
Q

What is a Git Distributed Version Control System (VCS)?

A

Every contributor can get a local copy or “clone” of the main repository. Every programmer can maintain
a local repository which is the copy or clone of the central repository which is present on their hard drive.

They can commit and update their local repository without any hassles.
They can update their local repositories with the new data from the central server by an operation called “pull” and affect changes to the main repository by an operation called “push” from their local repository.

27
Q

How does Git work?

A

Conflict resolution. Sometimes, when multiple people work on the same piece of code, conflicts
can arise. Git has built-in mechanisms to highlight these conflicts, allowing developers to manually
resolve them before finalizing a merge.

Log. To view the history of your commits, Git provides the git log command. This shows a list of
commits, their unique IDs, and the messages associated with them.

28
Q

What are branches?

A

Different line of developments