Jetty/Contributor/DevelopingWithGit
Contents
DEPRECATED: Obtaining code via GIT
Jetty has its source control on dev.eclipse.org, which is accessible via two different URLs.
- Anonymous, read-only access: http://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/
- Developers, read-write, requires an account on dev.eclipse.org: svn+ssh://{userid}@dev.eclipse.org/svnroot/rt/org.eclipse.jetty/
Choose your access technique and follow along:
- Make sure you have git-svn installed. You can do that by checking if there is help for you:
git svn --help
- Use git-svn to clone the subversion tree to your local disk. This pulls the jetty tree from Subversion, from the HEAD revision, via git-svn, to your local disk as a directory called "jetty".
The command line is a bit long, so here is a helper bash script to make this task a bit easier:
#!/bin/bash JETTYSVNROOT=http://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty git svn clone -r HEAD \ --branches $JETTYSVNROOT/branches \ --tags $JETTYSVNROOT/tags \ --trunk $JETTYSVNROOT/trunk \ $JETTYSVNROOT
You now have the codebase in git format to work with.
Installing Eclipse Plugins
We recommend these Eclipse plugins:
- Maven Integration - m2eclipse
Update Site: http://m2eclipse.sonatype.org/update
- GIT Team Provider - jgit
Update Site: http://www.jgit.org/updates
Importing into Eclipse
To import Jetty into Eclipse:
- Start Eclipse.
- Ensure that the recommended Eclipse plugins listed above are installed.
- Open the "Import Maven Projects" dialog by going to File > Import ... > General > Maven Projects.
- Browse to the 'git-svn' cloned directory for Jetty and import all projects.
Using GIT From a Subversion User Point of View
Git, like Subversion, is at home on the command line. Unlike Subversion, Git can operate entirely without network access. When you modify files and commit your changes, you are only commiting them to the local Git repository that you have recently checked out. Those changes do not exist outside of your own personal Git repository.
The Git - SVN Crash Course is a good reference for those familiar with Subversion, but new to Git. The crash course gives a comparison of popular Subversion commands and what their Git equivalents are.
Here are a few of the most common git commands.
- git svn rebase
- Performs an update from the Subversion repository at dev.eclipse.org to your local Git repository, of the active branch, followed by a merge of active content into your local changes.
- git svn dcommit
- Performs a push of the changes in your active Git repository branch to the Subversion repository at dev.eclipse.org.
- git commit
- Performs a local commit of changes to your local Git repository.
- git status
- Shows the status of the changes made in your working directory (pending commits, modified files, untracked files, etc...).
- git log
- Shows a log of changes in your local Git repository.
- NOTE: Your local changes are always at the top of this log; other entries below your changes show a 'git-svn-id' message indicating that it is content being tracked from the Subversion repository.
- git add {filename}
- Adds a file to the pending commit to your local Git repository.