Lecture 14 and 15: Revision Control and git Flashcards

1
Q

What is revision/version control?

A

Mechanism for managing changes made to files
Supports collaboration

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

What is a centralized model?

A

Single authoritative repository
All code checked in/out from this location
Single source of version history
Local changes aren’t “versioned”

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

What is a distributed model?

A

No authoritative copy, only working copies
Each repository (copy) contains all branches and revision history
Common operations are fast
Communication only occurs when sharing changes
Push/pull changes

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

Delta vs. snapshot storage

A

Delta stores each files’ changes individually, only changes made since last backup
Snapshot stores all files’ states at any given point

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

What is the general git workflow?

A

git config, git init (working repository), git clone (creates complete copy of the repository locally)

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

What is the working directory?

A

Refers to the currently checked out version of the project
This is where you work

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

Tracked vs. Untracked

A

Tracked files are in the last snapshot (unmodified, modified, staged)
Untracked is everything else
All files are tracked and unmodified in an initial clone

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

What are the tracked states?

A

Committed: Exists in local repository, usually pointed to by HEAD
Staged: Marked for the next commit, stored in the Index
Modified: File has changed, but not committed nor marked

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

What does git status do?

A

Shows the state of the working tree

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

What does git add do?

A

Begins tracking a new file
Stage files for commit that have been modified
Adds the file to the Index

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

What does git restore do?

A

Unstages a file

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

What does git commit do?

A

Record changes in the repository (move index to repository)

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

What is branching with git?

A

Allows you to work without interfering with the main code. Isolate changes, allowing for experimentation

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

What is merging with git?

A

Checkout the branch you want to merge onto
Merge the other branch
Resolve conflicts

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

How to work with remote with git?

A

Fetch: Obtain changes
Merge/Pull: Fetches and merges
Push: Push changes elsewhere

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

What is a pull request in git?

A

Code is merged based on trust
Contributor requests the maintainer pull their source code changes

17
Q

What is rebasing with git?

A

Similar to merging, but creates a linear history
Can help commits apply cleanly on a remote branch
Replays changes from one line of work onto another, in order
Moves the entire branch to a new base commit
Don’t rebase commits that exist outside of your repository

18
Q

What is cherry picking with git?

A

Checkout a branch, look at the log and select specific commits from one branch and apply them to another branch

19
Q

How to deal with bugs in git?

A

Bisecting, mark commits as good or bad
Binary Search, not linear