git Flashcards

(11 cards)

1
Q

git add

A

Purpose: Adds changes in the working directory (modified or new files) to the staging area in preparation for committing.
When to Use: After editing or creating files, and before committing those changes to the repository.

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

git commit

A

Purpose: Records changes from the staging area into the repository’s history. A commit represents a snapshot of your project.
When to Use: After using git add to stage changes, and when you’re ready to save your progress with a meaningful message.

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

git push

A

Purpose: Sends your local commits to a remote repository (e.g., on GitHub).
When to Use: After committing changes locally and when you want to share your work with others or back it up to the remote repository.

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

git pull

A

Purpose: Fetches the latest changes from a remote repository and integrates them into your current branch.
When to Use: When you want to update your local repository with changes made by others or on the remote server.

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

git clone

A

Purpose: Creates a local copy of a remote repository.
When to Use: When you want to start working on an existing project hosted on a remote platform (e.g., GitHub).

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

Fork

A

Purpose: Creates a personal copy of someone else’s repository on your GitHub account.
When to Use: When you want to contribute to another repository or experiment with it without affecting the original repository.

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

Branch-and-Merge Workflow

A

Purpose: A strategy for collaborative development where changes are made in separate branches and later merged into the main branch.
When to Use:
When developing new features or fixing bugs, so you can isolate your work from the main codebase.

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

Pull Request

A

Purpose: Proposes changes from one branch (typically on a fork or feature branch) to be reviewed and potentially merged into another branch (e.g., the main branch of the original repository).
When to Use: When you want others to review your changes before they are merged into the project’s main codebase.

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

Reasons for Using Version Control (Git)

A

Collaboration: Enables multiple developers to work on the same project without conflicts.
Change Tracking: Tracks every change to the codebase, including who made changes and why.
Branching and Merging: Allows developers to experiment in isolated branches and merge changes safely.
Backup and Recovery: Provides a history of changes, enabling easy rollback to previous versions if needed.
Code Quality: Supports code reviews and collaboration workflows like pull requests.
Distributed Development: Facilitates working across different locations with a distributed repository model.
Continuous Integration: Integrates easily with CI/CD pipelines to automate testing and deployment.

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

What is a non-trivial merge conflict between two branches?

A

A non-trivial merge conflict occurs when Git cannot automatically reconcile changes between two branches during a merge because the changes are too complex or involve overlapping modifications.

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

common ways that merge conflicts are resolved

A

Local merge/rebase to the feature branch and push.
Local merge/rebase the main branch and push.
Merge request (i.e. GitHub pull request)

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