Git & GitHub Flashcards
Version Control
Previous versions of a project are stored in the history so we don’t need to have a million separate files
Some benefits of version control
Collaboration
Restoring old work
Centralizing progress tracking
Merging separate work together
Git
A tool for version control! (created by Linus Torvalds)
Stores project files in repositories
Repository
A central location where data is stored and managed
9 simplified steps to creating a repo
- Create a folder you want to become a repo (getting a box)
- cd into the folder (opening the box)
- touch index.html
- edit index.html to your liking (making the gift)
- git init
- git add -A (putting the gift into the box)
- git commit -m “write a message describing your changes” (sealing the box and adding a message)
- Create a new repo in GitHub
- Follow GitHub instructions starting with git branch -M main (send the gift to the recipient)
Remote Addresses
The URL you send your project to to be stored on GitHub - (git remote -v)
Push
sending outside of my machine
Origin
recipient address (GitHub)
Main or Master
Default branch
Fork
Taking a copy of someone else’s repo on GitHub. This will save a new version to your account so you can edit the repo without messing up the original code.
Parallelizing
Doing work on multiple machines at once while maintaining unified codebass