Introduction to Git and Github
Planned Agenda INTRODUCTION COMMANDS DEMO OPENSOURCE CONCLUSION 0 1 0 2 0 3 0 4 0 5 What is Git? What is the need to learn it? Git Commands Live Demo for visualising each command What is Opensource? Some Opensource Opportunities General Discussions and Doubts
Let’s Git Started
Git /ɡɪt/ "A silly, incompetent, stupid, annoying or childish person" https://en.wiktionary.org/wiki/git
What's in store for us? What is Git?
GIT ORIGIN STORY Linus Torvalds created Git in 2005 https://www.linuxjournal.com/content/git-origin-story
Windows User ?? https://git-scm.com/download/win Well, if its LINUX - here you go UBUNTU: sudo apt-get install git OR FEDORA: sudo yum install git Ohh, Or is it MacOS ! https://git-scm.com/download/mac Installation Guide https://git-scm.com/downloads
What to do once Git is installed FOR FIRST TIME USERS?? Excuse me, Can I get your ID? git config --global user.name "Your Name" git config --global user.email "your@email.com" Color Preferences git config --global color.ui auto Ummm.... Are we good to proceed now ? git config --list
0 1 Introduction to version Control "Git is an example of Version Control" WHAT IS VERSION CONTROL Version Control is a system that records changes to a file or a set of files over time so that you can recall specific versions later
0 2 0 1 Introduction to version Control "Git is an example of Version Control" WHAT IS VERSION CONTROL Version Control is a system that records changes to a file or a set of files over time so that you can recall specific versions later WHY ? Revert files, Revert Project Compare Changes, See who modified it , and much more
0 2 0 1 0 3 Introduction to version Control "Git is an example of Version Control" WHAT IS VERSION CONTROL Version Control is a system that records changes to a file or a set of files over time so that you can recall specific versions later WHY ? Revert files, Revert Project Compare Changes, See who modified it , and much more GIT THEN ... Git is officially defined as a distributed version control system (VCS).
0 2 0 1 0 3 0 4 Introduction to version Control "Git is an example of Version Control" WHAT IS VERSION CONTROL Version Control is a system that records changes to a file or a set of files over time so that you can recall specific versions later WHY ? Revert files, Revert Project Compare Changes, See who modified it , and much more GIT THEN ... Git is officially defined as a distributed version control system (VCS). USAGE Efficiently work together and collaborate on team projects, where each developer can have their own version of the project, distributed.
0 2 0 1 0 3 0 4 0 5 Introduction to version Control "Git is an example of Version Control" WHAT IS VERSION CONTROL Version Control is a system that records changes to a file or a set of files over time so that you can recall specific versions later WHY ? Revert files, Revert Project Compare Changes, See who modified it , and much more GIT THEN ... Git is officially defined as a distributed version control system (VCS). USAGE Efficiently work together and collaborate on team projects, where each developer can have their own version of the project, distributed. CONCLUSION Obviously, Let's Learn Git !!!
Without Version Control
Is Git the only Version Control System available in this world ? No. Surely not
Here you go..
BUT WHY IS EVERYONE BEHIND GIT?
The Bigger Picture Uses Cases and Reason to use it
Git might feel difficult at first, but once you learn it, you never want to go back to anything less flexible and powerful Ahh. So many issues are here. Fed up Arey yaar, let's switch to GUIs. Why do we waste time in using Git Who invented this, when its of no use. Why can't people just invent good things in this world
Still Find Git CLI hard to use ?? https://desktop.github.com/
A git repository is a directory / folder that stores files, source codes and basically a collection of things that can be tracked and a history can be maintained of "Who made what changes & when" Don't confuse a folder with a repository "A repository is a folder that can track changes"
Untracked Staged Modified Committed Tracked You Modify, Create, Edit your files here
Untracked Staged Modified Committed Tracked You stage the files, adding snapshots to staging area git add Add Files
Untracked Staged Modified Committed Tracked You commit which permanently stores the snapshot to the Git Directory git commit Add Files Commit
Untracked Staged Modified Committed Tracked If you modify (optional) your file, then ?? Add Files Commit Edit
Untracked Staged Modified Committed Tracked So the cycle goes on.. Add Files Commit Edit Stage file for commit
Git Repositories 2 REMOTE REPOSITORY Generally stored outside of your isolated local system, usually on a remote server. It's especially useful when working in teams - this is the place where you can share your project code, see other people's code and integrate it into your local version of the project, and also push your changes to the remote repository. 1 LOCAL REPOSITORY A repository stored on your own computer, where you can work on the local version of your project.
Centralised or Distributed
Centralised De-Centralised or Distributed
The Three Stages Untracked files refer to files that are not in the staging area and not in the latest snapshot. The current version of the modified file has been proposed by you to commit. 2 STAGED 1 UNTRACKED 3 COMMITED Means that the changes to data have been stored in the database.
Windows User ?? https://git-scm.com/download/win Well, if its LINUX - here you go UBUNTU: sudo apt-get install git OR FEDORA: sudo yum install git Ohh, Or is it MacOS ! https://git-scm.com/download/mac Installation Guide
What to do once Git is installed FOR FIRST TIME USERS?? Excuse me, Can I get your ID? git config --global user.name "Your Name" git config --global user.email "your@email.com" Color Preferences git config --global color.ui auto Ummm.... Are we good to proceed now ? git config --list
To initialize a repository, Git creates a hidden directory called .git. That directory stores all of the objects and refs that Git uses and creates as a part of your project's history. This hidden .git directory is what separates a regular directory from a Git repository. git init
The git add command adds new or changed files in your working directory to the Git staging area. git add is an important command - without it, no git commit would ever do anything. git add git add . git add <file-name> git add <file-1> <file-2> <file-3>
git commit git commit -m "Descriptive message" git commit git commit --amend Creates a commit, which is like a snapshot of your repository. These commits are snapshots of your entire repository at specific times. You should make new commits often, based around logical units of change.
The git clone command is used to create a copy of a specific repository or branch within a repository. When you clone a repository, you don't get one file, like you may in other centralized version control systems. By cloning with Git, you get the entire repository - all files, all branches, and all commits. Cloning a repository is typically only done once, at the beginning of your interaction with a project. git clone origina l cloned
git clone [url] Clone (download) a repository that already exists on GitHub, including all of the files, branches, and commits. git clone --mirror Clone a repository but without the ability to edit any of the files. This includes the refs, or branches. You may want to use this if you are trying to create a secondary copy of a repository on a separate remote and you want to match all of the branches. git clone --branch <branch-name> <repository-link> Clone only a single branch
git push git push -u origin [branch] git push --force git push --all Uploads all local branch commits to the corresponding remote branch. Updates the remote branch with local commits. It is one of the four commands in Git that prompts interaction with the remote repository. You can also think of git push as update or publish.
Owner: XYZ Repo A Origin is the default name given to the original remote repository that you clone, from where you want to pull and push changes XYZ Owner: ABCD Repo K Remote: origin
Resources -> Git Kraken (A Good Cheatsheet for Commands) : https://www.gitkraken.com/learn/git/commands -> Getting Started with Git Documentation : https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git- Setup -> Getting Started with Git Video (For visual learners): https://www.youtube.com/watch?v=RGOj5yH7evk -> Getting Started with GitHub Documentation : https://docs.github.com/en/get-started/onboarding/getting- started-with-your-github-account -> GitHub Student Developer Pack (A must for y’all): https://education.github.com/pack -> Inner Workings of Git (Optional but good to know): https://www.freecodecamp.org/news/git-under-the-hood/ -> Visualising Git Commands (Good Practice Ground): https://learngitbranching.js.org/ -> Git Commit Best Practices (Please no more “edit” / “more changes” in commits): https://www.gitkraken.com/learn/git/best-practices/git-commit- message
"It is much better to know something about everything than to know everything about one thing"
Open Discussion What is Open Source ?
Open Source is all about Collaboration, rather than Competition
But.. Contributing to Open Source?
Why should I contribute? Contributing to open source can be a rewarding way to learn, teach, and build experience in just about any skill you can imagine. ● Improve existing skills ● Meet people who are interested in similar things ● Find mentors and teach others ● It’s empowering to be able to make changes, even small ones
Good Open Source Opportunities Check the links given for the details
MLH Fellowship - https://fellowship.mlh.io Google Summer of Code - https://summerofcode.withgoogle.com/about/ Hacktoberfest - https://hacktoberfest.digitalocean.com LFX Mentorship Program - https://mentorship.lfx.linuxfoundation.org/#projects_all CNCF Mentoring - https://github.com/cncf/mentoring LFN Mentorship Program - https://wiki.lfnetworking.org/display/LN/LFN+Mentorship+Program Girlscript - https://gwoc.girlscript.tech/ Girlsript WoC - https://gssoc.girlscript.tech/ Reinforcement Learning Open Source Fest - https://www.microsoft.com/en- us/research/academic-program/rl-open-source-fest/
GNOME Internships - https://wiki.gnome.org/Outreach Outreachy Internships - https://www.outreachy.org Google Season of Docs - https://developers.google.com/season-of-docs/docs/get-started X.Org Endless Vacation of Code - https://www.x.org/wiki/XorgEVoC/ Julia Seasons of Contributions (JSoC) - https://julialang.org/ Summer of Haskell - https://summer.haskell.org Open Mainframe Project Mentorship Program- https://www.openmainframeproject.org/projects/mentorship-program 24 Pull Requests - https://24pullrequests.com/about Linux Kernel Mentorship Program - https://wiki.linuxfoundation.org/lkmp Delta Winter of Code - https://dwoc.io/
OSOC - https://osoc.be Hyperledger mentorship program - https://wiki.hyperledger.org/display/INTERN/Hyperledger+Mentorship+Program Season of KDE 2021 - https://season.kde.org DataONE Summer Internship Program - https://old.dataone.org/internships Intern at the FSF - https://www.fsf.org/volunteer/internships Processing Foundation Fellowships - https://processingfoundation.org/fellowships/ FOSSASIA Codeheat - https://codeheat.org FOSSASIA Internship Program - https://docs.google.com/forms/d/e/1FAIpQLScp8h5SIPVK5G2SAm5vtrv7KLKeOeYTxlZBkDRE6I7Toybt0A/viewfo r m DrivenData Competitions - https://www.drivendata.org/competitions/ Kubernetes Release Team Shadows - https://github.com/kubernetes/sig-release/blob/master/release- team/shadows.md
Time for your task! Write a technical article on what you have learnt today Deadline – 28th December 6 pm Submission Link – Would be sent in Winter Hacks Group Rubrics - Would be sent in Winter Hacks Group Resources: -> https://towardsdatascience.com/my-6-step-process-for-writing-technical-articles-9d2f22026a5f -> https://www.freecodecamp.org/news/developers-the-why-and-how-to-writing-technical-articles-54e824789ef6/
THANK YOU

Introduction to GitHub, Open Source and Tech Article

  • 1.
  • 2.
    Planned Agenda INTRODUCTION COMMANDS DEMO OPENSOURCE CONCLUSION 0 1 0 2 0 3 0 4 0 5 What is Git? Whatis the need to learn it? Git Commands Live Demo for visualising each command What is Opensource? Some Opensource Opportunities General Discussions and Doubts
  • 3.
  • 4.
    Git /ɡɪt/ "A silly,incompetent, stupid, annoying or childish person" https://en.wiktionary.org/wiki/git
  • 5.
    What's in storefor us? What is Git?
  • 6.
    GIT ORIGIN STORY LinusTorvalds created Git in 2005 https://www.linuxjournal.com/content/git-origin-story
  • 8.
    Windows User ?? https://git-scm.com/download/win Well,if its LINUX - here you go UBUNTU: sudo apt-get install git OR FEDORA: sudo yum install git Ohh, Or is it MacOS ! https://git-scm.com/download/mac Installation Guide https://git-scm.com/downloads
  • 9.
    What to doonce Git is installed FOR FIRST TIME USERS?? Excuse me, Can I get your ID? git config --global user.name "Your Name" git config --global user.email "your@email.com" Color Preferences git config --global color.ui auto Ummm.... Are we good to proceed now ? git config --list
  • 10.
    0 1 Introduction to versionControl "Git is an example of Version Control" WHAT IS VERSION CONTROL Version Control is a system that records changes to a file or a set of files over time so that you can recall specific versions later
  • 11.
    0 2 0 1 Introduction to versionControl "Git is an example of Version Control" WHAT IS VERSION CONTROL Version Control is a system that records changes to a file or a set of files over time so that you can recall specific versions later WHY ? Revert files, Revert Project Compare Changes, See who modified it , and much more
  • 12.
    0 2 0 1 0 3 Introduction to versionControl "Git is an example of Version Control" WHAT IS VERSION CONTROL Version Control is a system that records changes to a file or a set of files over time so that you can recall specific versions later WHY ? Revert files, Revert Project Compare Changes, See who modified it , and much more GIT THEN ... Git is officially defined as a distributed version control system (VCS).
  • 13.
    0 2 0 1 0 3 0 4 Introduction to versionControl "Git is an example of Version Control" WHAT IS VERSION CONTROL Version Control is a system that records changes to a file or a set of files over time so that you can recall specific versions later WHY ? Revert files, Revert Project Compare Changes, See who modified it , and much more GIT THEN ... Git is officially defined as a distributed version control system (VCS). USAGE Efficiently work together and collaborate on team projects, where each developer can have their own version of the project, distributed.
  • 14.
    0 2 0 1 0 3 0 4 0 5 Introduction to versionControl "Git is an example of Version Control" WHAT IS VERSION CONTROL Version Control is a system that records changes to a file or a set of files over time so that you can recall specific versions later WHY ? Revert files, Revert Project Compare Changes, See who modified it , and much more GIT THEN ... Git is officially defined as a distributed version control system (VCS). USAGE Efficiently work together and collaborate on team projects, where each developer can have their own version of the project, distributed. CONCLUSION Obviously, Let's Learn Git !!!
  • 15.
  • 16.
    Is Git theonly Version Control System available in this world ? No. Surely not
  • 17.
  • 18.
  • 19.
    The Bigger Picture UsesCases and Reason to use it
  • 20.
    Git might feeldifficult at first, but once you learn it, you never want to go back to anything less flexible and powerful Ahh. So many issues are here. Fed up Arey yaar, let's switch to GUIs. Why do we waste time in using Git Who invented this, when its of no use. Why can't people just invent good things in this world
  • 21.
    Still Find Git CLIhard to use ?? https://desktop.github.com/
  • 23.
    A git repositoryis a directory / folder that stores files, source codes and basically a collection of things that can be tracked and a history can be maintained of "Who made what changes & when" Don't confuse a folder with a repository "A repository is a folder that can track changes"
  • 24.
    Untracked Staged Modified Committed Tracked YouModify, Create, Edit your files here
  • 25.
    Untracked Staged Modified Committed Tracked Youstage the files, adding snapshots to staging area git add Add Files
  • 26.
    Untracked Staged Modified Committed Tracked Youcommit which permanently stores the snapshot to the Git Directory git commit Add Files Commit
  • 27.
    Untracked Staged Modified Committed Tracked Ifyou modify (optional) your file, then ?? Add Files Commit Edit
  • 28.
    Untracked Staged Modified Committed Tracked Sothe cycle goes on.. Add Files Commit Edit Stage file for commit
  • 31.
    Git Repositories 2 REMOTE REPOSITORY Generallystored outside of your isolated local system, usually on a remote server. It's especially useful when working in teams - this is the place where you can share your project code, see other people's code and integrate it into your local version of the project, and also push your changes to the remote repository. 1 LOCAL REPOSITORY A repository stored on your own computer, where you can work on the local version of your project.
  • 32.
  • 33.
  • 35.
    The Three Stages Untrackedfiles refer to files that are not in the staging area and not in the latest snapshot. The current version of the modified file has been proposed by you to commit. 2 STAGED 1 UNTRACKED 3 COMMITED Means that the changes to data have been stored in the database.
  • 36.
    Windows User ?? https://git-scm.com/download/win Well,if its LINUX - here you go UBUNTU: sudo apt-get install git OR FEDORA: sudo yum install git Ohh, Or is it MacOS ! https://git-scm.com/download/mac Installation Guide
  • 37.
    What to doonce Git is installed FOR FIRST TIME USERS?? Excuse me, Can I get your ID? git config --global user.name "Your Name" git config --global user.email "your@email.com" Color Preferences git config --global color.ui auto Ummm.... Are we good to proceed now ? git config --list
  • 38.
    To initialize arepository, Git creates a hidden directory called .git. That directory stores all of the objects and refs that Git uses and creates as a part of your project's history. This hidden .git directory is what separates a regular directory from a Git repository. git init
  • 39.
    The git addcommand adds new or changed files in your working directory to the Git staging area. git add is an important command - without it, no git commit would ever do anything. git add git add . git add <file-name> git add <file-1> <file-2> <file-3>
  • 40.
    git commit git commit-m "Descriptive message" git commit git commit --amend Creates a commit, which is like a snapshot of your repository. These commits are snapshots of your entire repository at specific times. You should make new commits often, based around logical units of change.
  • 41.
    The git clonecommand is used to create a copy of a specific repository or branch within a repository. When you clone a repository, you don't get one file, like you may in other centralized version control systems. By cloning with Git, you get the entire repository - all files, all branches, and all commits. Cloning a repository is typically only done once, at the beginning of your interaction with a project. git clone origina l cloned
  • 42.
    git clone [url] Clone(download) a repository that already exists on GitHub, including all of the files, branches, and commits. git clone --mirror Clone a repository but without the ability to edit any of the files. This includes the refs, or branches. You may want to use this if you are trying to create a secondary copy of a repository on a separate remote and you want to match all of the branches. git clone --branch <branch-name> <repository-link> Clone only a single branch
  • 43.
    git push git push-u origin [branch] git push --force git push --all Uploads all local branch commits to the corresponding remote branch. Updates the remote branch with local commits. It is one of the four commands in Git that prompts interaction with the remote repository. You can also think of git push as update or publish.
  • 44.
    Owner: XYZ Repo A Originis the default name given to the original remote repository that you clone, from where you want to pull and push changes XYZ Owner: ABCD Repo K Remote: origin
  • 46.
    Resources -> Git Kraken(A Good Cheatsheet for Commands) : https://www.gitkraken.com/learn/git/commands -> Getting Started with Git Documentation : https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git- Setup -> Getting Started with Git Video (For visual learners): https://www.youtube.com/watch?v=RGOj5yH7evk -> Getting Started with GitHub Documentation : https://docs.github.com/en/get-started/onboarding/getting- started-with-your-github-account -> GitHub Student Developer Pack (A must for y’all): https://education.github.com/pack -> Inner Workings of Git (Optional but good to know): https://www.freecodecamp.org/news/git-under-the-hood/ -> Visualising Git Commands (Good Practice Ground): https://learngitbranching.js.org/ -> Git Commit Best Practices (Please no more “edit” / “more changes” in commits): https://www.gitkraken.com/learn/git/best-practices/git-commit- message
  • 47.
    "It is muchbetter to know something about everything than to know everything about one thing"
  • 48.
  • 49.
    Open Source isall about Collaboration, rather than Competition
  • 50.
  • 51.
    Why should Icontribute? Contributing to open source can be a rewarding way to learn, teach, and build experience in just about any skill you can imagine. ● Improve existing skills ● Meet people who are interested in similar things ● Find mentors and teach others ● It’s empowering to be able to make changes, even small ones
  • 52.
    Good Open Source Opportunities Check thelinks given for the details
  • 53.
    MLH Fellowship -https://fellowship.mlh.io Google Summer of Code - https://summerofcode.withgoogle.com/about/ Hacktoberfest - https://hacktoberfest.digitalocean.com LFX Mentorship Program - https://mentorship.lfx.linuxfoundation.org/#projects_all CNCF Mentoring - https://github.com/cncf/mentoring LFN Mentorship Program - https://wiki.lfnetworking.org/display/LN/LFN+Mentorship+Program Girlscript - https://gwoc.girlscript.tech/ Girlsript WoC - https://gssoc.girlscript.tech/ Reinforcement Learning Open Source Fest - https://www.microsoft.com/en- us/research/academic-program/rl-open-source-fest/
  • 54.
    GNOME Internships -https://wiki.gnome.org/Outreach Outreachy Internships - https://www.outreachy.org Google Season of Docs - https://developers.google.com/season-of-docs/docs/get-started X.Org Endless Vacation of Code - https://www.x.org/wiki/XorgEVoC/ Julia Seasons of Contributions (JSoC) - https://julialang.org/ Summer of Haskell - https://summer.haskell.org Open Mainframe Project Mentorship Program- https://www.openmainframeproject.org/projects/mentorship-program 24 Pull Requests - https://24pullrequests.com/about Linux Kernel Mentorship Program - https://wiki.linuxfoundation.org/lkmp Delta Winter of Code - https://dwoc.io/
  • 55.
    OSOC - https://osoc.be Hyperledgermentorship program - https://wiki.hyperledger.org/display/INTERN/Hyperledger+Mentorship+Program Season of KDE 2021 - https://season.kde.org DataONE Summer Internship Program - https://old.dataone.org/internships Intern at the FSF - https://www.fsf.org/volunteer/internships Processing Foundation Fellowships - https://processingfoundation.org/fellowships/ FOSSASIA Codeheat - https://codeheat.org FOSSASIA Internship Program - https://docs.google.com/forms/d/e/1FAIpQLScp8h5SIPVK5G2SAm5vtrv7KLKeOeYTxlZBkDRE6I7Toybt0A/viewfo r m DrivenData Competitions - https://www.drivendata.org/competitions/ Kubernetes Release Team Shadows - https://github.com/kubernetes/sig-release/blob/master/release- team/shadows.md
  • 56.
    Time for yourtask! Write a technical article on what you have learnt today Deadline – 28th December 6 pm Submission Link – Would be sent in Winter Hacks Group Rubrics - Would be sent in Winter Hacks Group Resources: -> https://towardsdatascience.com/my-6-step-process-for-writing-technical-articles-9d2f22026a5f -> https://www.freecodecamp.org/news/developers-the-why-and-how-to-writing-technical-articles-54e824789ef6/
  • 58.