Introduction to
Git and GitHub
What, Why and How?
About me
• MicroserviceTester @ Ericsson
• Current Interest: Embedded Hardware
• Learningto play flute
• Love to play sports and cook
• linkedin.com/in/faisal-hussain-elte/
Understanding the problem
• The traditional way has only:
• CTRL+S
• CTRL+Z, CTRL+Y (Until you save)
• Doesn't work for more than 1 person
• Unorganized
Understanding the problem
• What was changed?
• Why was it changed? Can you always remember
this?
• Small changes but the size doubles
• Messy and difficult to collaborate with others
• It's painfully slow 🐌
Git Version Control
• Version Control = Track Changes 🙆‍♂️
• Developed by LinusTorvalds 16 years ago
• Free and open source 💲
• Lightningfast
• Distributed(Spread out over the internet
across multiple people)
• It’s not only for code!
• It's a separate entity on it's own.
When and Where will I use this?
• Functional programming
(IP-18fFUNPEG) repository
• Tools of software projects (IP-18KVPRJG)
• Software Technology (IP-12SRPRJG)
• Internship& Job
• Every project when you understand Git
GitHub
• Largest code host in the world,
with 40 million users and more than 190
million repositories
• Partly a social network
• Nice project management tools baked in
Simplified Git dictionary
Traditional Git (Better at everything)
Download project.zip from google drive git clone <repository url>
Download project_final.zip git fetch
Create a new folder to start a new idea git branch
CTRL+S git commit
Make a new .zip and upload to google drive git push
Open 2 windows and compare manually git diff
CTRL+Z and CTRL+Y git checkout
A folder Repository (repo)
Command Line vs GUI
• Better to learn CLI as most of the help online is
in the form of CLI commands
• If you learn the git commands then you can use
every gui easily but not the other way around.
• In reality you will end up using both.
Children's Stories
• Management wants to start a story series about a cat and mouse and
their adventures.
• Using both Git and Github
• Collaboration between many writers
• The aim is to understandthe concepts through an easy example.
Setting up Git
• Install git from git-scm.com with default settings
• git config --global user.name "William Hanna"
• git config --global user.email "william.hanna@nbc.com"
Creating our
repo
• https://github.com/new
Our Repository
• Homepage/Dashboard
• Current Branch
• Number of branches and tags
• Number of commits
• Current commit hash (ID)
• Renders the readme file
Git clone
• Create a copy of the repository locally
• Clone using the HTTPS link
• git clone https://github.com/NobleAscent/stories.git
• Clone output really doesn't matter unless there is an
error
.git
• This is what makes git work.
• Just don't delete it or play with it.
• It’s hidden by default
Our First Story
Git status
• What's up?
• We must add files we want git to track.(Green)
• Untrackedmeans that git is ignoring this file. (Red)
• git add .
Git status
• Git add takes the file from untrackedto staged. (Green)
• Only staged files are includedin a commit.
• Adding and editing files is not very different.
Git commit
• Commit messages tell us what and why?
• 5fe4f2f is the identifier of the commit
• Write good commit messages so the intent
and execution are clear
• Bad commit messages cause headaches
Git push
• Lets show it to the boss
• 5fe4f2f is the identifier of the commit
• Just tells us statisticsabout it’s performance
Giving feedback
• Lets point out some problems and improvements
• Go over the commit and select the line to
reference
• Create an issue
Giving feedback
• Tag developers
• Tag a specific commit or line
• Attach files and paste screenshots
Giving feedback
• Tag developers
• Tag a specific commit or line
• Attach files and paste screenshots
Git diff
• The writer fixed the story and wants to see his changes
Beginner git workflow
• add
• commit
• push
GitHub diff
• Can be seen by pressingon the commit hash
In the dashboard
or in the commit history as well
Lets be writer2
• We need to collaborate to successfully
resolve the issue.
• Both writers will work together on this project
Lets be writer2 (Getting the repo)
Lets be writer2 (Git status)
• Rename is equivalent to deleting and creatinga new file
• We need to git add the deleted file as well otherwise it
would not be includedin the commit
Lets be writer2 (Git push)
• Add, commit & push.In the commit message we can tag the issue.
Lets be writer2 (Git push)
• Add, commit & push.
• In the commit message we can tag
the issue and close it
automatically
Quick Recap
• Commands we had to run once:
clone
• Commands we had to run multiple times:
add, commit,push
• Optional commands but very helpful:
diff
Medium Git Workflow
• branch (A copy for experimentation)
• checkout (Switch and Use the specified branch)
• add
• commit
• push
• pull request (Merge the branch)
• Demo time (https://git-school.github.io/visualizing-git/)

Intro to Git & GitHub

  • 1.
    Introduction to Git andGitHub What, Why and How?
  • 2.
    About me • MicroserviceTester@ Ericsson • Current Interest: Embedded Hardware • Learningto play flute • Love to play sports and cook • linkedin.com/in/faisal-hussain-elte/
  • 3.
    Understanding the problem •The traditional way has only: • CTRL+S • CTRL+Z, CTRL+Y (Until you save) • Doesn't work for more than 1 person • Unorganized
  • 4.
    Understanding the problem •What was changed? • Why was it changed? Can you always remember this? • Small changes but the size doubles • Messy and difficult to collaborate with others • It's painfully slow 🐌
  • 5.
    Git Version Control •Version Control = Track Changes 🙆‍♂️ • Developed by LinusTorvalds 16 years ago • Free and open source 💲 • Lightningfast • Distributed(Spread out over the internet across multiple people) • It’s not only for code! • It's a separate entity on it's own.
  • 6.
    When and Wherewill I use this? • Functional programming (IP-18fFUNPEG) repository • Tools of software projects (IP-18KVPRJG) • Software Technology (IP-12SRPRJG) • Internship& Job • Every project when you understand Git
  • 7.
    GitHub • Largest codehost in the world, with 40 million users and more than 190 million repositories • Partly a social network • Nice project management tools baked in
  • 8.
    Simplified Git dictionary TraditionalGit (Better at everything) Download project.zip from google drive git clone <repository url> Download project_final.zip git fetch Create a new folder to start a new idea git branch CTRL+S git commit Make a new .zip and upload to google drive git push Open 2 windows and compare manually git diff CTRL+Z and CTRL+Y git checkout A folder Repository (repo)
  • 9.
    Command Line vsGUI • Better to learn CLI as most of the help online is in the form of CLI commands • If you learn the git commands then you can use every gui easily but not the other way around. • In reality you will end up using both.
  • 10.
    Children's Stories • Managementwants to start a story series about a cat and mouse and their adventures. • Using both Git and Github • Collaboration between many writers • The aim is to understandthe concepts through an easy example.
  • 11.
    Setting up Git •Install git from git-scm.com with default settings • git config --global user.name "William Hanna" • git config --global user.email "[email protected]"
  • 12.
  • 13.
    Our Repository • Homepage/Dashboard •Current Branch • Number of branches and tags • Number of commits • Current commit hash (ID) • Renders the readme file
  • 14.
    Git clone • Createa copy of the repository locally • Clone using the HTTPS link • git clone https://github.com/NobleAscent/stories.git • Clone output really doesn't matter unless there is an error
  • 15.
    .git • This iswhat makes git work. • Just don't delete it or play with it. • It’s hidden by default
  • 16.
  • 17.
    Git status • What'sup? • We must add files we want git to track.(Green) • Untrackedmeans that git is ignoring this file. (Red) • git add .
  • 18.
    Git status • Gitadd takes the file from untrackedto staged. (Green) • Only staged files are includedin a commit. • Adding and editing files is not very different.
  • 19.
    Git commit • Commitmessages tell us what and why? • 5fe4f2f is the identifier of the commit • Write good commit messages so the intent and execution are clear • Bad commit messages cause headaches
  • 20.
    Git push • Letsshow it to the boss • 5fe4f2f is the identifier of the commit • Just tells us statisticsabout it’s performance
  • 21.
    Giving feedback • Letspoint out some problems and improvements • Go over the commit and select the line to reference • Create an issue
  • 22.
    Giving feedback • Tagdevelopers • Tag a specific commit or line • Attach files and paste screenshots
  • 23.
    Giving feedback • Tagdevelopers • Tag a specific commit or line • Attach files and paste screenshots
  • 24.
    Git diff • Thewriter fixed the story and wants to see his changes
  • 25.
    Beginner git workflow •add • commit • push
  • 26.
    GitHub diff • Canbe seen by pressingon the commit hash In the dashboard or in the commit history as well
  • 27.
    Lets be writer2 •We need to collaborate to successfully resolve the issue. • Both writers will work together on this project
  • 28.
    Lets be writer2(Getting the repo)
  • 29.
    Lets be writer2(Git status) • Rename is equivalent to deleting and creatinga new file • We need to git add the deleted file as well otherwise it would not be includedin the commit
  • 30.
    Lets be writer2(Git push) • Add, commit & push.In the commit message we can tag the issue.
  • 31.
    Lets be writer2(Git push) • Add, commit & push. • In the commit message we can tag the issue and close it automatically
  • 32.
    Quick Recap • Commandswe had to run once: clone • Commands we had to run multiple times: add, commit,push • Optional commands but very helpful: diff
  • 33.
    Medium Git Workflow •branch (A copy for experimentation) • checkout (Switch and Use the specified branch) • add • commit • push • pull request (Merge the branch) • Demo time (https://git-school.github.io/visualizing-git/)