Are you part of a software development team that's recently moved to GitHub? Where some team members are excited to use git for source control but you're more comfortable with…
Are you part of a software development team that’s recently moved to
GitHub? Where some team members are excited to use git for source control but
you’re more comfortable with Subversion? The good news is that you can
all use the tools you already enjoy – GitHub repositories can be accessed from
both Git and Subversion (SVN) clients.
This is an overview of how you can take advantage of
the GitHub Flow
from your favorite Subversion client.
The GitHub Flow involves iterating through the following steps for each
masterbranch; discuss the
The first thing you’ll want to do is a Subversion checkout. Since Git clones keep the
working directory (where you edit files) separate from the repository
data, there is only one branch in the working directory at a time.
Subversion checkouts are different — they mix the repository data in the
working directories, so there is a working directory for each branch and
tag you’ve checked out. For repositories with many branches and tags,
checking out everything can be a bandwidth burden; so you should start
with a partial checkout.
GitHub supports both Git and Subversion clients using the HTTP protocol,
start by browsing to the repository page on github.com to get the HTTP clone URL:
Then get your checkout ready:
$ svn co --depth empty https://github.com/widgetmakers/gizmo Checked out revision 1. $ cd gizmo
$ svn up trunk A trunk A trunk/README.md A trunk/gizmo.rb Updated to revision 1.
branchesdirectory. This is
HEADbranches live, and where you’ll be making
$ svn up --depth empty branches Updated to revision 1.
The first step is to create a topic branch from the latest
branch. From your svn client, make sure
master is current by updating
trunk; then use
svn copy to create a branch.
$ svn up trunk At revision 1. $ svn copy trunk branches/more_awesome A branches/more_awesome $ svn commit -m 'Added more_awesome topic branch' Adding branches/more_awesome Committed revision 2.
You can see that the new branch is there from the web interface or a git
$ git fetch From https://github.com/widgetville/gizmo * [new branch] more_awesome -> origin/more_awesome
Add some features, fix some
bugs, and make plenty of commits along the way. This works like the
Subversion you’re used to – edit your file(s) and use
svn commit to
record your changes.
$ svn status M gizmo.rb $ svn commit -m 'Guard against known problems' Sending more_awesome/gizmo.rb Transmitting file data . Committed revision 3.
$ svn status ? test $ svn add test A test A test/gizmo_test.rb $ svn commit -m 'Test coverage for problems' Adding more_awesome/test Adding more_awesome/test/gizmo_test.rb Transmitting file data . Committed revision 4.
When you have your changes ready to share with the rest of the team, use
the web interface to make a Pull Request:
Your changes will now be in the
master branch; use
svn update to bring your checkout up to date, and then start working on the next awesome thing!