Version Control with Git

Version Control with Git

Rails Girls Frankfurt 2015 Talk by Claudius Coenen


Rails Girls Frankfurt

September 19, 2015


  1. Version Control with Git Claudius Coenen License: CC-BY-4.0

  2. Why Version Control? welcome.html

  3. Why Version Control? welcome.html welcome_final.html welcome_final2.html welcome_final2-bernd.html welcome2.html welcome_2.html welcome_final2.html

    welcome_2.html welcome.html welcome_final.html welcome_final2-bernd.html welcome2.html • So, what is the newest version of this file? • Who changed the title? • Yesterday, it was working just fine. • Did you get my mail? • Who's working on XYZ? • Is this bugfix already included somewhere? • Who is working on this project, anyway?
  4. Safe-Keeping of Versions • When you check something into version

    control, it will remember this exact version for you • You can return to a previous version • You get a fancy timeline of your project Today Yesterday, 10:04 10.10.2012 14:12 06.03.2012 14:10
  5. Conflict Resolution • Files edited by different people can usually

    be resolved automatically. welcome.html (Alice) welcome.html (Bob) welcome.html (Both changes)
  6. The „Commit“ • An item in the history • Think

    of this as a snapshot of your project commit f303d887ebf263b466958ca7c83aebb9385936f0 Author: Claudius Coenen <> Date: Sat Feb 15 02:08:44 2014 +0100 Ticket #2342: fixing file upload to work with animated gif Commit-Hash Commit-Message
  7. Full Workflow • DO STUFF change files the way you

    normally would • PREPARE git add the changes, so git knows about them • COMMIT git commit, preferably with a nice message think: committing to memory or: committment git pull git push
  8. Branching/Merging And The History

  9. Branching/Merging And The History #§%$!~?? Appropriate use of Comic Sans!

  10. Branching/Merging And The History Merge Branch starts here Usually no

  11. Git Command Line Interface

  12. Github App

  13. Atlassian SourceTree

  14. References

  15. Command Cheat Sheet (Infrequent Commands) • git config --global

    “Jane Doe“ • git config --global ““ • git config --global color.ui true • git config --system core.editor <editor> • git init (creates a new repository) • git clone <repository url> („clones“ existing)
  16. Command Cheat Sheet (Frequent Commands) • git status • git

    log • git add • git commit • git checkout • git reset These Commands are Local! (what's up on my drive) (what happened so far) (prepare these files for commit) (commit the added files) (return to a previous version) (reset the git index)
  17. Command Cheat Sheet (Used often) • git fetch • git

    pull • git push (just download) (download AND merge) (send my changes out) These Commands go over the network* *) simplification
  18. Where to Start • Baby steps in your browser – • Download git for your system – • Maybe add a Git client that suits your taste – At least try the commandline. Git in its purest form. – gitk, GitHub-App, SourceTree, GitTower, TortoiseGit • Integrate git into your IDE / Editor – Eclipse, Sublime, WebStorm, RubyMine, NetBeans
  19. Hand-Picked Resources • Git has extensive documentation – •

    There's a lot of Tutorials out there – – – – – • In-Depth Info – • Cannon fodder for lengthy debates with your fellow geek –