Git In One Evening

2,192
-1

Published on

High-level presentation on version control using Git

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
2,192
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Git In One Evening

  1. 1. Git in one Evening● Who am I, and what is my context?● Why use version control at all?● What are the options?● Why choose git?● Git basics● Github goodies● Git as part of your workflow● Questions and discussion
  2. 2. Who am I, anyway?● Long time developer (perl, php)● Primarily work in Drupal● I work with a small team – Im the primaryback-end dev, we have one themer● I do sometimes contribute to the Drupalproject.
  3. 3. Why use version control?● Also called “revision control” or “sourcecontrol”● Use cases (code == text files)– Solo, CMS site building, no custom code(useful at times)– Solo, CMS site building, custom code (themefiles, etc.) (very useful)– Solo or Team, custom code (essential)– Team, CMS site building, custom code(essential)
  4. 4. Version Control Options● Old skool: CVS/SVN (client/server)● New skool: Git, Bazaar, Mercurial (distributed)● Git is by far the most popular, and hasbecome the industry standard for versioncontrol. Used for the Linux kernel● Mercurial is used by Python, and others● Bazaar is used by Ubuntu, and supported byCanonical
  5. 5. Distributed Version Control● SVN (and its predecessor, CVS) had onlyone repository, and it was central. Youcommitted code to that repository. Yourworking copy is only a copy of the code, withmetadata (in the form of .svn directories).● With distributed version control, everyone hasa repository – so every version is basically afork.
  6. 6. Distributed Version Control, cont.● Synchronization can happen by peersexchanging patches● Commits, reverts, etc. are fast, because theyhappen locally.● You can work productively (like on a plane)without having to connect to a server● Branching and forking are a lot easier● It is easier to contribute to open sourceprojects
  7. 7. Why Learn Git?● It is distributed version control● It is the most popular● It is used for the drupal project (I noticewordpress is still using SVN.)● It is in increasing use in PaaS systems(Heroku, etc.)● Youll improve your chances of getting a job(git knowledge is increasingly asked for.)
  8. 8. How to get git● Linux– apt-get install git (Ubuntu/Debian)– yum install git-core (Fedora/CentOS)– Download from http://git-scm.com/● Mac OS X– Graphical Gitinstaller:http://code.google.com/p/git-osx-installer– MacPorts● Windows– http://msysgit.github.io/
  9. 9. Git Tools● IDEs/Editors that integrate with git– Eclipse– Netbeans– TextMate● Git GUIs– Gitg– Katana– Others● https://git.wiki.kernel.org/index.php/InterfacesFrontendsAndTools
  10. 10. Git GUI (gitg)
  11. 11. Basic Git● Creating a git repository● Cloning a git repository● Making changes● Viewing status● Staging changes● Committing changes● Pushing and Pulling● Undoing mistakes
  12. 12. More Git Commands● Clone a repository: ‘git clonessh://user@domain/repo.git’● Add an origin: ‘git remote add <remote>user@domain/repo.git’● Pulling from a remote: ‘git pull <remote><branch>
  13. 13. Let’s Do It!
  14. 14. Git Repository Hosting● You could theoretically do peer-to-peer, butthe standard is to have a “bare” repositoryhosted somewhere● You can easily host it yourself on a VPS● Commercial hosting options provide goodies– GitHub– Bitbucket– Others
  15. 15. GitHub● github.com● Free for open source/public projects● Modest cost for private repository hosting● Lots of nice goodies, including issue tracking
  16. 16. Git Workflow● Depends on use case● Teams● Branches● Remotes as “servers” a la cvs/svn● Challenges integrating with DB based CMSconfig changes
  17. 17. Got Questions?● I might have answers
  18. 18. Michelle Murrain● michelle@murrain.net● @pearlbear on twitter● pearlbear on d.o.
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×