Working with Git – For Orbital – whoami

Working with Git – For Orbital – whoami

5 1


On Github laurenceputra / Orbital-Git-Workshop

Working with Git

For Orbital

How to get started, and what you need to get going

by Laurence Putra

Slides can be found at


Recently graduated geek

Engineer at BillPin

Organiser at GeekcampSG

Heads and contributes to a bunch of other user groups

Experience with Git

3 years

Moved a company to Git

Still have tons to learn

What you'll be learning today

What can Git do?

How do you fit it into your workflow

Live Exercise with Git

What is Git?

Before we answer that ...

Who here plays computer games?

(Angry birds not counted)

Git works like your checkpoint system in computer games

Have checkpoints along the way

And when you do something really stupid

Go back to your saved game and resume

No more trying to figure out what you edited

Why Git?

Yea, I get the whole idea about Git, but I can simply name my files
and sync it using Sugarsync (or Dropbox) to the rest of my team.

Yea, you can do that

But as you join bigger teams in future (bigger projects or work), how do you keep track what changes are made in what files?

Or who release v2-0?

And will v2-1 contain the updates from v2-0?

Setting up

Who here hasn't set up?

Install Git

Connecting to Github

Create a repo on Github too.

Windows specific

  • Use Git Bash only
  • Checkout Windows-style, commit Unix-style line endings

Basic config

Windows users open git bash

Mac and Linux users open terminal

Type in these 2 lines

git config --global "John Doe"
git config --global

Functionalities of Git

clone add commit push pull status checkout


git clone

Copies an existing repository onto your machine

git clone

git status

Tells you what changes have been made to your repository

git add

Adds files you have changed to the changes that need to be staged

git add index.html


git add -A

git commit

Commits your changes to your own machine

git commit


git commit -m "This is the commit message"

git push

Pushes the changes to another server

git push

yea, that's it

git pull

Gets changes your teammates make

git pull

Assuming John and Peter pull the same stuff from yesterday, and now John updates the code.

Peter has made changes to the code as well, and cannot push.

Peter has to do a

git pull

which will merge the code in automatically


In case of conflicts (computer unable to decide how to merge)


Commit after you have manually merged it

Try to not have more than 1 person edit the same line to prevent such problems from happening

git checkout

Retrieve the old checkpointed file you did something stupid to

git checkout folder1/*.c
git checkout folder1/

Best Practices

Meaningful commit messages

Recap, how to commit?

git commit -m "message"

Bad commit messages

It works!
You should have trusted me. 
Committed some changes
This is a basic implementation that works. 

More bad examples over at

Commit frequency

How often should you commit?

Every new feature

When they are working!


Look up branching if you have time

Read up more about Git as you use it more

Learn to RTFM

When all fails...

I'll be around

Useful readings


The Git Book

The End

If you ever are looking for a job in future, drop me an email. I'm almost always hiring, either for the company I'm working for, or for someone else. You can contact me somehow at