1 of 18

Git

The version control system

2 of 18

Who are we?

Pål-Jørgen Valdersnes

Works as a consultant for Bouvet��Backend developer, security researcher and pentester��Contact at: pal-jorgen.valdersnes@bouvet.no

​

Marius Kalvø

Works as a consultant for Bouvet

Full stack developer, Fullstack/DevOps at Sparebanken Vest��Contact at: marius.kalvo@bouvet.no

​

​

3 of 18

Our sponsors

Bouvet is a Norwegian consultant firm with over 1000 employees, assisting businesses in all areas of IT, communication, and business development.

Customers (in Bergen) includes Statoil, TV2, Statkraft, Sparebanken Vest, and Bergen kommune, among others.

http://www.bouvet.no/

https://utbrudd.bouvet.no/

​

VIS bidrar til at samfunnsutfordringer løses effektivt, og at kunnskap og ideer kommer raskt til nytte. Forskere, gründere og etablert næringsliv kommer til VIS med utfordringer og ideer som vi videreutvikler sammen.

​

4 of 18

Nerdschool resources

  • All presentations are public on Google Docs
  • Git repository pr workshop
  • Static web page with info (how to come prepared)
  • Meetup for signup and feedback

5 of 18

Git

6 of 18

Agenda

  • What is Git?
  • How is Git different from other version control systems?
  • How to use Git?
  • Git vs. GitHub

7 of 18

What is Git?

  • Version Control System
  • Tracks how text changes over time.
  • Versions the diffs instead of the entire file
  • Both local and distributed

8 of 18

How is Git different?

  • It’s decentralized
    • Local repository
    • Remote repository (“origin”)
  • Easy and fast to create branches
  • More fine-grained control e.g. cherry-picking

9 of 18

How to use Git?

  • Mostly used on the command line
  • There are GUI clients
    • SourceTree
    • GitHub Desktop
    • SmartGit
    • ++
  • Learn the basics on the CLI first
  • The CLI can do more than most GUI clients

10 of 18

How to really use Git?

  • Small commits
  • Isolated commits
  • Pull often
  • Merge often
  • Do your work in a custom branch (feature/task based)
  • Short-lived branches

11 of 18

Git vs GitHub

  • Git is a version control system
  • GitHub is a web-based hub for code and collaboration
    • Stores your Git repository
    • Handles access and authorization to repositories
    • Forks of repositories
    • Pull request management
    • Issue tracking
    • Lots more…

12 of 18

GitHub: forks

  • A full copy of a repository to your account
  • The Git equivalent of copying a folder from one computer to another
  • A GitHub only feature, not in Git itself

13 of 18

GitHub: pull request

  • John finds the coolest repository ever
  • It has an unsolved Issue which John knows how to solve
  • He forks the repository to his account
  • He makes the code changes
    • Commits the changes locally
    • Pushes them to his Remote (GitHub)
  • Goes to GitHub and manually makes a pull request
    • “I fixed your Issue #123. Please merge these commits into your repository”
  • Jane is notified of the pull request in the original repository
  • She reviews the changes
  • She merges the changes into the original repository
  • The unsolved Issue is solved and closed

14 of 18

GitHub, the social open source hub

  • Many companies and products have their code public on GitHub
  • Many accepts (and wants) help
  • Sometimes Issues are earmarked for open source beginners
    • http://up-for-grabs.net/
  • Issues are for discussions as well as bugs
  • GitHub has graphs for activity over time
    • How healthy/up to date is a project?

15 of 18

Demo

  • Interactive cheat sheet
  • A whirlwind tour of GitHub

16 of 18

Assigments

17 of 18

Assignments

  • Go to https://github.com/nerdschoolbergen/git
  • Ask if you’re stuck���WIFI: �SSID: VIS-gjest�Password: visdet2019

18 of 18

Next meetup

​

Introduction to JavaScript and web development

07/9/19

http://www.meetup.com/Bergen-Nerdschool/

Remember to sign up! (It’s really important!)