GitHub is a website and cloud-based service that helps developers store and manage their code, as well as track and control changes to their code
-
Git
Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.
-
Version Control System
describes a type of software that is designed specifically to help manage the complexities - and so much more!
- Automatically create a backup of your work
- Provide an easy way to undo mistakes and restore a previous version of your work
- Document changes with a log that describes what's been changed and why
- Keep file names and hierarchies consistent and organized
- Branch work off into multiple "sandboxes" (called branches in Git) that allow developers to experiment without impacting other branches
- Collaborate with others without disturbing each other's or our own work
-
Repository(or repo in short)
A directory of files that are tracked by Git.
-
Track
When a file is tracked by Git, it means that Git will notice any changes to that file. We call these changes differences or diffs. Git allows you to choose whether to commit a diff in order to keep it.
-
Diff
The diff of a file is all the changes that have been made to it since the last commit. The diff of a repo is all the diffs in all the tracked files in the repo that have not yet been committed (sometimes programmers call this the diffset)
-
Commit
Once we decide we want to save a diff, we commit the diff to the repo's history using the commit command. When we make a commit, we write a log message that describes what happened in the diff. The set of commits provides a history of all of the changes that have been made to a repo and when.
-
Log
A record of what happened in each commit.
-
Local/Remote
Local refers to the repo on our personal system the local repo.Remote refers to the repo hosted on GitHub
-
Branch/default branch
A Git repo can support multiple branches that make it possible for multiple developers to be working on the code at the same time.When you initialize a new Git repo a default branch is created (main) where your work will be tracked by default.
-
Pull Requests
These are hearts of collaborations. With a pull request you are proposing that your changes should be merged with the main branch from your branch..
git branch <Branch name>
git checkout -b <branch name>
git checkout <branch name>
-
- Git
- VsCode
-
-
-
sudo apt update sudo apt upgrade sudo apt install code
if this does not work install vscode manually using this link here if you still insist on installing using the terminal then read this article and follow the instructions here
-
# apt-get install git # add-apt-repository ppa:git-core/ppa # apt update # apt install git
-
- How to install vscode extensions:
- From Extensions > Manage Extensions, find the extension you want to install. (If you know the name or part of the name of the extension, you can search in the Search window.)
- Select Download.
- Must have extensions:
- colorize
- Prettier
- icon fonts
- live server
- bracket pair colorizer
- js ES6 snippet
- live share extension
- if you have not sign-up proceed to this url Github signup webpage
- Fill out the form and create an account
- verify Email Address connected to your Github Account
if you were able to verify email address, continue below
Git is the tool we use to download and upload our code online. To use Git without signing every time, you need to create a Secure Shell (SSH) key and associate that to your GitHub account.
- Open the terminal in your vsCode or gitbash in windows or press
ctrl + `
on linux - Type
git config --global user.name
+Space
+ your name and pressEnter
. (Note this should be your full name, not your GitHub username, in quotes) Type git config --global user.email
+Space
+ the email address you used to sign up to GitHub and pressEnter
- Type
git config --global init.defaultBranch main
to update the default branch name to main - Type
ssh-keygen and press
Enter
.For each prompt do not type anything, just continue to pressEnter
. It's particularly important that you do not enter a passphase; you should leave the passphrase empty when prompted. - Type
cat ~/.ssh/id_rsa.pub | clip.exe
and pressEnter
. This will copy your SSH key to your clipboard - Open the Github New SSH key form (NOTE: You need to be logged in to access this link)
- Type "My personal PC" in the "Title" input field
- Paste what's on your clipboard from step six in the "Key" input field
- Click "Add SSH Key"
If you see your new SSH key beneath the "SSH keys" heading You have finally managed to configure your github...