On Github laurenceputra / Orbital-Git-Workshop
Slides can be found at http://bit.ly/orbitalgit
Recently graduated geek
Engineer at BillPin
Organiser at GeekcampSG
Heads and contributes to a bunch of other user groups
3 years
Moved a company to Git
Still have tons to learn
What can Git do?
How do you fit it into your workflow
Live Exercise with Git
Before we answer that ...
(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
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?
Who here hasn't set up?
Install Git http://git-scm.com/downloads
Connecting to Github http://bit.ly/orbitalgitssh
Create a repo on Github too.
Windows users open git bash
Mac and Linux users open terminal
Type in these 2 lines
git config --global user.name "John Doe" git config --global user.email johndoe@example.com
Copies an existing repository onto your machine
git clone git@github.com:laurenceputra/Orbital-Git-Workshop.git
Tells you what changes have been made to your repository
Adds files you have changed to the changes that need to be staged
git add index.html
OR
git add -A
Commits your changes to your own machine
git commit
OR
git commit -m "This is the commit message"
Pushes the changes to another server
git push
yea, that's it
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)
>>>> stuff <<<<
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
Retrieve the old checkpointed file you did something stupid to
git checkout folder1/*.c
git checkout folder1/app.py
Recap, how to commit?
git commit -m "message"
stuff
It works!
You should have trusted me.
Committed some changes
ALL SORTS OF THINGS
This is a basic implementation that works.
More bad examples over at http://whatthecommit.com/
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
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 GeekSphere.net