Github Basics Flashcards

1
Q

Why does Github exist/why is it useful?

A
  • Version Control: Instead of keeping track of multiple different version of files, Git does that for you
  • Collaboration: Allows for many people to work on projects together
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the difference between Git and Github?

A

Github:
* website/web service where you can do Git operations on the website.

Git:
* Actual version control software/application

(note that both can operate independently from one another)

(Github runs the Git behind the scenes)
(social network for Git)

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

What is a repository/repo?

A
  • A project that can have multiple files associated with it

(note git repos cant have spaces in name)

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

What is a commit?

`

A
  • Think of it like a save
  • after commiting a file, it is viewable in the repository
  • Best to make a new comment for each commit to describe the changes you made
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How do you view previous versions/history in Github?

A

You can view history of commits by selecting ‘History’ button to see what changes were made.

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

What is a commit hash?

A

A unique identifier for a commit you make. It appears in both the URL and next to the commit you make.

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

What is a Github branch?

A
  • When you create a new repo, the history of commits made are on the master branch
  • When you make a branch, you are creating a separate path of commits under that new branch
  • If you decide to merge branch to master branch, you can do a pull request by doing ‘compare and pull request’
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How can you view the different branches?

A

Go to graphs, then network to visualize the branch pathway.

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

What is a pull request?

A
  • Request to merge your branch into the master branch.
  • By merging pull request, the branch will merge into the master branch.
  • Sending a pull request is you the user sending a request to the repo owner to pull the branch you are commiting
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does it mean to fork a repository?

A
  • Taking an entire other instance of a repo and having it under your account
  • Forking gives you an exact replica of the entire repository and it’s commit history (so the branches and main branch will be the same)
  • If you don’t have permission to edit a file in someone’s repo, github automatically offers to fork it so you can edit your own version of the project.
  • Forking will allow you to see the forked repo in your account
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is a merge conflict?

A

When two people make changes to the same lines of code.

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