git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* newbie question about git push
@ 2008-08-27 15:37 Eric Bowman
  2008-08-27 15:52 ` Peter Harris
  2008-08-27 16:06 ` Michael J Gruber
  0 siblings, 2 replies; 3+ messages in thread
From: Eric Bowman @ 2008-08-27 15:37 UTC (permalink / raw)
  To: git

Hi,

Apologies in advance if this has been covered before ... I've been 
wading through the archives a bit and couldn't find anything that seemed 
to address this basic question.

I have a bunch of machines I use for development, but only one of them 
is allowed to connect via vpn to where the subversion repository lives, 
so I'm using git-svn to make things a little easier.

I've got one machine, itchy, where I've done a git svn clone operation.  
I do a fair amount of development work there, and typically I just work 
on the master branch, and periodically commit back to svn using git svn 
dcommit.

I've cloned the repository on itchy on a few other machines I 
occasionally use, and I'm able to push new revisions from itchy with no 
surprises, and I can pull revisions back to itchy ok with no surprises.

Where things get a weird is when I push a revision back to itchy from 
one of my other clones.  I feel like I must be missing some fundamental 
concept, and I'm wondering if someone can help.

Suppose I make a change on another machine commit that change, then push 
it back to itchy:

git commit -as
git push origin master

This works ok, and I can then git svn dcommit that change back to the 
svn.  But I have a hard time getting that change to show up in the 
sandbox I have on itchy.

When I go back to itchy after pushing from a satellite, git thinks that 
the old revision of the file I modified on another machine, has been 
modified locally; it doesn't see that the local copy is out of data and 
this new revision needs to be merged.  But I can't figure out how to get 
git to do that; the only things that seem to work are fairly drastic 
measures,  like "git reset --hard" or by stashing and then deleting the 
stash. Either seems terribly error prone.

I'm starting to think that I should clone the repo I cloned from svn for 
doing development work on itchy, but this seems kind of wasteful.  Am I 
missing some fundamental concept?

Many thanks for any thoughts.

cheers,
Eric

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: newbie question about git push
  2008-08-27 15:37 newbie question about git push Eric Bowman
@ 2008-08-27 15:52 ` Peter Harris
  2008-08-27 16:06 ` Michael J Gruber
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Harris @ 2008-08-27 15:52 UTC (permalink / raw)
  To: Eric Bowman; +Cc: git

On Wed, Aug 27, 2008 at 11:37 AM, Eric Bowman wrote:
> Where things get a weird is when I push a revision back to itchy from one of
> my other clones.  I feel like I must be missing some fundamental concept,
> and I'm wondering if someone can help.

This is a FAQ.
http://git.or.cz/gitwiki/GitFaq#head-b96f48bc9c925074be9f95c0fce69bcece5f6e73

> I'm starting to think that I should clone the repo I cloned from svn for
> doing development work on itchy, but this seems kind of wasteful.  Am I
> missing some fundamental concept?

I always clone my svn mirrors for doing development work.

It's not particularly wasteful, especially if you set up the svn
mirror as an alternate for your working repo. ("git clone -s", but
make sure you read "git help clone" so that you know why you can't
delete anything from the svn mirror)

Peter Harris

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: newbie question about git push
  2008-08-27 15:37 newbie question about git push Eric Bowman
  2008-08-27 15:52 ` Peter Harris
@ 2008-08-27 16:06 ` Michael J Gruber
  1 sibling, 0 replies; 3+ messages in thread
From: Michael J Gruber @ 2008-08-27 16:06 UTC (permalink / raw)
  To: git

Eric Bowman venit, vidit, dixit 27.08.2008 17:37:
> Hi,
> 
> Apologies in advance if this has been covered before ... I've been 
> wading through the archives a bit and couldn't find anything that seemed 
> to address this basic question.
> 
> I have a bunch of machines I use for development, but only one of them 
> is allowed to connect via vpn to where the subversion repository lives, 
> so I'm using git-svn to make things a little easier.
> 
> I've got one machine, itchy, where I've done a git svn clone operation.  
> I do a fair amount of development work there, and typically I just work 
> on the master branch, and periodically commit back to svn using git svn 
> dcommit.
> 
> I've cloned the repository on itchy on a few other machines I 
> occasionally use, and I'm able to push new revisions from itchy with no 
> surprises, and I can pull revisions back to itchy ok with no surprises.
> 
> Where things get a weird is when I push a revision back to itchy from 
> one of my other clones.  I feel like I must be missing some fundamental 
> concept, and I'm wondering if someone can help.
> 
> Suppose I make a change on another machine commit that change, then push 
> it back to itchy:
> 
> git commit -as
> git push origin master
> 
> This works ok, and I can then git svn dcommit that change back to the 
> svn.  But I have a hard time getting that change to show up in the 
> sandbox I have on itchy.
> 
> When I go back to itchy after pushing from a satellite, git thinks that 
> the old revision of the file I modified on another machine, has been 
> modified locally; it doesn't see that the local copy is out of data and 
> this new revision needs to be merged.  But I can't figure out how to get 
> git to do that; the only things that seem to work are fairly drastic 
> measures,  like "git reset --hard" or by stashing and then deleting the 
> stash. Either seems terribly error prone.
> 
> I'm starting to think that I should clone the repo I cloned from svn for 
> doing development work on itchy, but this seems kind of wasteful.  Am I 
> missing some fundamental concept?
> 
> Many thanks for any thoughts.
> 
> cheers,
> Eric

I don't think I understand your situation completely. But could it be
that when you push from satellite to itchy you push into a branch which
is checked out? Most probably, because you seem to push master to
master. You can't merge on push because there may be conflicts.

That setup is generally not a good idea, for the reasons you've
experienced. You may want to pull from itchy instead.

Michael

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-08-27 16:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-27 15:37 newbie question about git push Eric Bowman
2008-08-27 15:52 ` Peter Harris
2008-08-27 16:06 ` Michael J Gruber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).