Git Flashcards

1
Q

What is Git?

A

Git is a Distributed Version Control system (DVCS).

It can track changes to a file and allows you to revert back to any particular change.

Its distributed architecture provides many advantages over other Version Control Systems (VCS) like SVN.

A major advantage is that it does not rely on a central server to store all the versions of a project’s files.

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

What is a distributed architecture?

A

??

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

What is Git fork? What is difference between fork, branch and clone?

A

FORK:
- a remote, server-side copy of a repository, distinct from the original.

CLONE:

  • a local copy of some remote (not on your laptop) repository
  • when you clone, you are copying the entire source repository, including all the history and branches.

BRANCH:

  • a way to handle the changes within a single repository in order to eventually merge them with the rest of code
  • a thread of development
  • branch out to work on a new feature without effecting the master code
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the difference between “git pull” and “git fetch”?

A

git pull does a git fetch, followed by a git merge.

When you use pull, Git will merge any pulled commits into the branch you are currently working in.

Pull automatically merges the commits without letting you review them first. If you don’t closely manage your branches, you may run into frequent conflicts.

FETCH
When you fetch, Git gathers any commits from the target branch that do not exist in your current branch and stores them in your local repo, but does not merge them.

This is particularly useful if you need to keep your repository up to date, but are working on something that might break if you update your files.

To integrate the commits into your master branch, you use merge.

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

What is a pull request?

A

When someone branches out, completes changes and tries to merge that branch into the main repo.

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

What is a centralised workflow?

A

The Centralized Workflow uses a central repository (MASTER) to serve as the single point-of-entry for all changes to the project.

All changes are committed into this branch.

Developers start by cloning the central repository. In their own local copies of the project, they edit files and commit changes. These new commits are stored locally.

To publish changes to the official project, developers push their local master branch to the central repository. Before the developer can publish their feature, they need to fetch the updated central commits and rebase their changes on top of them.

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