I know how everyone loves git questions here, so this is a bit off topic,
but I have another crazy git question.  The situation is probably weird
enough that I might not be able to explain it well enough to get an answer,
but let me try.

The situation is that I have a master git repository on my linux pc
(--bare).  I then cloned it from multiple places and I can push and pull
and commit from any of the remote clones (the clones that have a working
tree) and everything works as expected.

Now I'd like to also be able to pull and push and make changes (and keep in
sync) on a computer that is impossible to have on the network (it's an
embedded linux computer that has no network hardware and no way to add
any.)  The embedded linux computer has a full copy of git and a full native
development system right on board.

I am able to plug in a USB thumb drive, so my "brilliant" idea was to
create a clone of the master repository on the thumb drive.  The clone on
the thumb drive is setup so it's remote path is valid when it is plugged
into my main linux desktop PC and can see the master repository from there.

I have a clone of the repository on my embedded system too, and it's remote
is setup to point to the clone on the thumb drive when that is plugged in.
 So I can plug the thumb drive into my main linux computer and run
pull/push against the master repository, or I can plug the thumb drive into
the embedded system and do pulls/pushes from the local embedded system with
the repository on the thumb drive acting as the remote master.  Then if
there are changes from the embedded system, I can move the thumb drive over
to the linux desktop PC, go to the thumb drive repository and run a push
from there to get the changes back into the master central repository ...
that was my theory at least and I though I had it working until I started
pushing changes around from a few different directions.

The clone on the thumb drive was originally just a simple clone with a
working tree, but I ran into problems making that the remote for my
embedded clone, so I went back and remade the thumb drive clone using the
--bare option.  But now I'm in a situation where I have changes from the
embedded system that I've pushed into the thumb drive repository.  And I
have changes from elsewhere that I've pushed into the master repository.

If I "cd" to the thumb drive repository and run git push (which I thought
would push my changes to the master repository) I get the following error:

$ git push
To /path/myrepo.git/
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to '/path/myrepo.git/'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')
hint: before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

However, my thumb drive repository is created with the --bare option so I
don't have a working tree, thus when I run "git pull" as per the suggestion
in the error message I get:

$ git pull
fatal: /usr/libexec/git-core/git-pull cannot be used without a working tree.

This may not make any sense the way I'm explaining it, or maybe I'm missing
something completely obvious?  But essentially I'm trying to work around
not having a network connection by creating a go-between repository clone
on a thumb drive.  Is this possible?

BTW, I looked at git clone --mirror, but I need to pass changes in both
directions to/from the embedded system through the thumb drive repository
so I don't think a pure mirror of the master repository will do what I want.

Any suggestions?

Thanks,

Curt.
-- 
Curtis Olson:
http://www.atiak.com - http://aem.umn.edu/~uav/
http://www.flightgear.org - http://gallinazo.flightgear.org
------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to