Git in 5

Steph Locke (@theStephLocke)

2020-04-27

version control all the things

SOURCE CONTROL IS FOR ALL THE THINGS

Who’s a git?

Not who* but what…

Git is source control that is

  • open source
  • distributed
  • command line based (GUIs implemented)
  • safe
  • not source safe!

* Well OK, Linus Torvald did name it after himself

A (simple) Git workflow

Clone a copy of the code

Take a copy of the code for you to work on without preventing anyone else from doing the same, and most definiitely not damaging the remote copy

git clone https://github.com/stephlocke/Rtraining.git

Branch the code

Branches are different containers of code - they don’t impact each other. This means that you can make them for features, for trying something out, for releases etc

git branch breakallthethings
git checkout breakallthethings

Make your changes

State your business

Tell git which bits of code you’re happy* with.

git add iLoveCursors.sql

* For various definitions of happy

Commit your code

Confirm your changes and tell your local git that you’re happy with them

git commit -m "I loves me some cursors"

Merge your code

Super happy with your? Publish it to the master branch

git checkout master
git merge breakallthethings -m "I didn't break all the things"

Push your code

Put new code on the remote location

git push

Git moah things

Git model

git model via @cthydng

Git resources

Git remotes

Git clients

Git advice