This document summarizes a presentation on using Git for version control of Joomla projects. It introduces Git and its basic commands like clone, init, status, add, commit, push, and pull. It discusses Git clients for different operating systems and hosting repositories on sites like GitHub. It provides recommendations for setting up Git for a Joomla project, establishing workflows, deployment, and handling database issues. The target audience is developers, programmers, and designers working on Joomla projects.
3. Who am I?
● Working with Joomla/Mambo since 2003
● Founded Manos (formerly Cory Webb Media,
LLC) in 2008
● Author of Beginning Joomla Website
Development (Wrox 2009)
4. Who are you?
● Developers/Programmers
● Designers
● Integrators
5. Agenda
● Why version control?
● Intro to Git
● Git Basics
● Git Clients
● Git Repository Hosting
● Using Git for Joomla Projects
● Questions
6. Why version control?
● Less of this: “I'm going to be working on
template.css today, so nobody touch it!”
● More of this: “Let's all work on template.css
today and use our version control system to
merge our changes at the end of the day!”
7. Why version control?
● Easier to work as a team
● Snapshots of your code at various stages of
development
● Branching, staging and experimentation
● Ability to revert back to previous versions
8. Intro to Git
● Off cial website: http://git-scm.com
i
● Distributed version control system
● Enables team collaboration
● Free and open source (GPLv2 license)
● Used by Joomla, Google, Facebook, Microsoft,
Twitter, LinkedIn, Netf ix, etc....
l
● Seamlessly branch and merge code changes
● Work locally
9. Intro to Git
● Multiple backups
● Custom workflows
● Data assurance
● Code staging
11. Git Basics | git clone
● Clone an existing Git repository
● Creates an exact copy of the repository
● Changes can be shared between the original
and the clone
● http://git-scm.com/docs/git-clone
12. Git Basics | git init
● Initialize a new git repository
● Create a new project from scratch
● http://git-scm.com/docs/git-init
13. Git Basics | git status
● Returns the current status of the repository
● Displays list of new, modified, and deleted files
● Displays list of changes staged for commit
● http://git-scm.com/docs/git-status
14. Git Basics | git add
● Add changes to the staging area
● Stage modifications (new files and changed
files) to be committed to the repository
● http://git-scm.com/docs/git-add
15. Git Basics | git commit
● Commits staged changes to the repository
● Add a comment using -m “Comment”
● Stage changes using -a after git commit
● http://git-scm.com/docs/git-commit
16. Git Basics | git push
● Updates remote repositories with local
repository
● http://git-scm.com/docs/git-push
17. Git Basics | git pull
● Fetches a remote repository or local branch and
merges changes with the local repository into
the current branch
● http://git-scm.com/docs/git-pull
18. Git Basics | git merge
● Merges 2 or more development histories
together
● http://git-scm.com/docs/git-merge
19. Git Basics | .gitignore
● File that specifies files within your project that Git
should ignore
● Using the git status command will not list files
from the .gitignore file
● Files listed will never be staged for commit or
committed
● http://git-scm.com/docs/gitignore
24. Using Git for Joomla Projects
● Getting started
● Establish your workflow
● Deployment
● Database issues
25. Git for Joomla | Getting Started
● Initialize the root directory of your Joomla project
with 'git init' in your local web server (MAMP)
● Install Joomla
● Set up your '.gitignore' file to specify files you don't
want to track
● Add your files to the repository with 'git add .'
● Commit your new files to the repository with 'git
commit -m “Initial commit”'
26. Git for Joomla | Getting Started
● Set up remote hosting for your repository
● Push your local repository to the remote hosting
● Each developer clones the repository to their
local systems
● TIP: Ignore the configuration.php file and let
that be specific to each developer's local repo.
27. Git for Joomla | Establish workflow
● Subversion-style Workflow
Image from git-scm.com
28. Git for Joomla | Establish workflow
● Integration Manager Workflow
Image from git-scm.com
29. Git for Joomla | Establish workflow
● Dictator and Lieutenants Workflow
Image from git-scm.com
30. Git for Joomla | Deployment
● BeanstalkApp.com enables easy deployment to
development, staging, and production servers
● Overwrite existing code files with the master
repository once it is deemed ready for
deployment
31. Git for Joomla | Database Issues
● Git does not track changes to a MySQL database
● Probably using different databases for each developer, the
development server, staging server and the production server
● Development usually involves changing the database (adding
articles, menu items, modules, etc. in Joomla)
● How do we deal with changes across so many different
databases?
32. Git for Joomla | Database Issues
● Option 1: Point all instances of Joomla to the same
remote database.
● Option 2: Manually track changes.
● Option 3: Use a database synchronization tool such as
red-gate.com/products/mysql/mysql-comparison-tools/
● Solution may vary depending on the details of your
project