Github Basics Flashcards
Why does Github exist/why is it useful?
- 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
What is the difference between Git and Github?
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)
What is a repository/repo?
- A project that can have multiple files associated with it
(note git repos cant have spaces in name)
What is a commit?
`
- 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 do you view previous versions/history in Github?
You can view history of commits by selecting ‘History’ button to see what changes were made.
What is a commit hash?
A unique identifier for a commit you make. It appears in both the URL and next to the commit you make.
What is a Github branch?
- 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 can you view the different branches?
Go to graphs, then network to visualize the branch pathway.
What is a pull request?
- 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
What does it mean to fork a repository?
- 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
What is a merge conflict?
When two people make changes to the same lines of code.