This started because I wanted to share a program I had been working on through Google Code.
First, I created the git repository by:
skp@pecan:~/app/workspaces/pscompare$ cd ProjectSarah/
skp@pecan:~/app/workspaces/pscompare/ProjectSarah$ ls
bin derby.log export.xml lib src timedb
skp@pecan:~/app/workspaces/pscompare/ProjectSarah$ git init
Initialized empty Git repository in /home/skp/app/workspaces/pscompare/ProjectSarah/.git/
skp@pecan:~/app/workspaces/pscompare/ProjectSarah$ git add .
skp@pecan:~/app/workspaces/pscompare/ProjectSarah$
Then, I did a commit:
skp@pecan:~/app/workspaces/pscompare/ProjectSarah$ git commit -m “First Release”Created initial commit 87fa855: First Release
196 files changed, 3456 insertions(+), 0 deletions(-)
create mode 100644 .classpath
create mode 100644 .project
create mode 100644 bin/com/skp/ProjectSarah/ChangeClientButton.class
create mode 100644 bin/com/skp/ProjectSarah/ClientListener.class
create mode 100644 bin/com/skp/ProjectSarah/CreateTimeViewExcel.class
create mode 100644 bin/com/skp/ProjectSarah/CreateTimesheetsButton.class
create mode 100644 bin/com/skp/ProjectSarah/DateField.class…
Now, I created a new directory and started following these directions. One of the problems I had was logging in. I had to use the “My Profile” link on the upper right hand corner of Google Code. That showed what my username was, and then, the password was on the Settings tab.
mkdir ~/app/git-workspace
cd ~/app/git-workspace
git svn clone –username <username> https://project-sarah.googlecode.com/svn/trunk
cd trunk
git fetch ~/app/workspaces/pscompare/ProjectSarah/
git branch tmp $(cut -b-40 .git/FETCH_HEAD)
git tag -a -m “Last fetch” last tmp
INIT_COMMIT=$(git log tmp –pretty=format:%H | tail -1)
git checkout $INIT_COMMIT .
git commit -C $INIT_COMMIT
git rebase master tmp
git branch -M tmp master
git svn dcommit
Now, I was able to browse the source of my program online!
Resources
- Develop with Git on a Google Code Project
- Export a Git Project to Google Code
- Distributed Version Control for Hosted Project Users
- Git Plugin for Eclipse
- Everyday Git with 20 Commands or So
- git-init(1)
- Git Magic
git branch tmp $(cut -b-40 .git/FETCH_HEAD)
3 thoughts on “Adding a Project to Git and Google Code”