Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Git and GitHub

Git and GitHub

Getting started with Git and GitHub is probably one thing that doesn't come that easy to budding developers. Hope this presentation helps you out.


Nakshatra Saxena

April 30, 2021


  1. Git and GitHub By @NakshatraCodes

  2. What are Git and GitHub? 🤔 Git is a version

    control tool used by developers around the 🌍 . It lets you manage and keep track of your source code history. GitHub is a code hosting platform for version control and collaboration. It lets you and others work together on projects from anywhere. 󰠁
  3. Installation 📥 1. Create your ID on GitHub - https://github.com/

    2. Download and Install Git - https://git-scm.com/downloads
  4. Configuring Git 📍 Run these commands on your terminal /

    shell 1. $ git config --global user.name "John Doe" 2. $ git config --global user.email "email@example.com" For more info visit - https://docs.github.com/en/github/getting-started-with-github/set-up-git
  5. How does it work? 1 2 3 a32bf89 a32bf90 a32bf91

  6. Working Directory Staging Area Local Repository 👉 git add git

    commit 👉 🚩 git reset 👈
  7. Do we have to commit everything? 🔐 Quite often you’ll

    find files / folders you don’t want people to look into. These can be some passwords, API Keys and stuff like that. You don’t have to commit these files to your Git repository. Just add a .gitignore file in your working directory and mention the files that you don’t want to commit inside it. Git will automatically ignore all the files you write inside the .gitignore
  8. Connecting to Remote 📡 To connect your current local repository

    to your GitHub Account. 1. Create a new repository by clicking on the ➕ icon in your Account 2. Add a remote origin to your local repository - $ git remote add origin https://github.com/<user>/<repo>.git 3. Push your local repository to remote $ git push -u origin master
  9. 🚩 Working Directory Staging Area Local Repository Remote Repository git

    push 👉 1 2 3 👉 git commit 1 2 3 .git GitHub git add 👉
  10. Branching and Merging 🌳 1 2 3 3 4 4

    5 5 git branch feature2 git checkout feature2 git merge feature2
  11. Cloning and Forking 🍴 You can directly clone any repository

    on GitHub into your local system. But it is good practice to first fork that repository in your account, and then clone it. git clone <URL>
  12. Steps to contribute in Open Source 🔓 1. Choose any

    project you’d like to work on 2. Fork the repository of that project into your own Account 🍴 3. Clone repository in your system - git clone <repoURL> 4. Code 󰠁 5. Create a new branch to work upon - git branch verification-module 6. Add these changes to staging - git add . 7. Commit your code - git commit -m “Add Verification Module” 8. Push code to YOUR remote repository 👉 9. Create a Pull Request 10. Wait for maintainers to merge your code ⌛
  13. Glossary 📔 Directory - A folder Repository - A folder

    where software packages are stored (generally) Commit - A snapshot of the current state of your code Push - When you upload a Local repo to a Remote repo Pull - When you Pull code from somewhere, like a Remote Repo Pull Request - A request to the maintainers of a repo to merge your code
  14. Hope you can now use Git and GitHub effectively.