tags:

views:

109

answers:

1

I have a GIT repo A which was setup using "git svn" from a subversion repo. I made a clone of A called B, where B is a bare repository(git clone --bare). I clone C from B, work on C and periodically push my changes to B (the reason I made B bare). Now, when I want to pickup the latest updates from subversion I run "git svn rebase" on repo A. How do I pull these updates from A to B. Moving to B and executing "git pull" fails with the error - "fatal: /usr/local/git-1.7.0/libexec/git-core/git-pull cannot be used without a working tree.". What is the correct way to move the updates from A to B

+1  A: 

Since B is bare, you probably want to push the changes from A into B.

What you've described seems like a lot of pushing and pulling without an obvious benefit. Normally you would use git-svn by working directly in the repository that you created using git svn clone. Is there a particular reason why you're creating all those extra repositories?

Greg Hewgill
Repository A has to reside on a system which is backed up regularly. My development machines are different from this backed up system. Hence two copies of the repository are required at a minimum. I kept the intermediate bare repo B because I wanted to regularly test the subversion code and the code with my new changes separately. Hence at that point I chose to have two separate repos A and B. It might have been possible to do this via branching, but thats the choice I made.
Aleph
@Aleph: Does the Subversion repository still exist, or did you stop using that and convert the repository to Git (in repo A)? If the Subversion repository still exists, I don't see why A has to exist at all, and you can just `git svn clone` on your development machine. If the Subversion repository no longer exists and A is now the master, then repo A should be converted to a bare repository so that you can push into it.
Greg Hewgill
There is a benefit to having these repositories. If you have multiple git-users who have to work against SVN, being able to clone and pull the latest changes from B speeds up the work immensely. A is a so-called "fetching" repo. The strategy is described here: http://stackoverflow.com/questions/1880405/The answer stands correct though. You should push from A to B.
Thomas Ferris Nicolaisen