{"thread":{"id":"15219","subject":"newbie question about git push","startedAt":"2008-08-27T15:37:20Z","lastAt":"2008-08-27T16:06:00Z","messageCount":3,"participants":["Eric Bowman","Peter Harris","Michael J Gruber"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"88729","messageId":"48B574B0.4030607@boboco.ie","threadId":"15219","inReplyTo":null,"subject":"newbie question about git push","fromName":"Eric Bowman","fromEmail":"ebowman@boboco.ie","sentAt":"2008-08-27T15:37:20Z","receivedAt":"2008-08-27T15:37:20Z","isPatch":false,"sender":{"key":"ebowman@boboco.ie","avatar":null},"body":"Hi,\n\nApologies in advance if this has been covered before ... I've been \nwading through the archives a bit and couldn't find anything that seemed \nto address this basic question.\n\nI have a bunch of machines I use for development, but only one of them \nis allowed to connect via vpn to where the subversion repository lives, \nso I'm using git-svn to make things a little easier.\n\nI've got one machine, itchy, where I've done a git svn clone operation.  \nI do a fair amount of development work there, and typically I just work \non the master branch, and periodically commit back to svn using git svn \ndcommit.\n\nI've cloned the repository on itchy on a few other machines I \noccasionally use, and I'm able to push new revisions from itchy with no \nsurprises, and I can pull revisions back to itchy ok with no surprises.\n\nWhere things get a weird is when I push a revision back to itchy from \none of my other clones.  I feel like I must be missing some fundamental \nconcept, and I'm wondering if someone can help.\n\nSuppose I make a change on another machine commit that change, then push \nit back to itchy:\n\ngit commit -as\ngit push origin master\n\nThis works ok, and I can then git svn dcommit that change back to the \nsvn.  But I have a hard time getting that change to show up in the \nsandbox I have on itchy.\n\nWhen I go back to itchy after pushing from a satellite, git thinks that \nthe old revision of the file I modified on another machine, has been \nmodified locally; it doesn't see that the local copy is out of data and \nthis new revision needs to be merged.  But I can't figure out how to get \ngit to do that; the only things that seem to work are fairly drastic \nmeasures,  like \"git reset --hard\" or by stashing and then deleting the \nstash. Either seems terribly error prone.\n\nI'm starting to think that I should clone the repo I cloned from svn for \ndoing development work on itchy, but this seems kind of wasteful.  Am I \nmissing some fundamental concept?\n\nMany thanks for any thoughts.\n\ncheers,\nEric\n"},{"id":"88730","messageId":"eaa105840808270852s5d5804b4md9a78efd6691f01f@mail.gmail.com","threadId":"15219","inReplyTo":"48B574B0.4030607@boboco.ie","subject":"Re: newbie question about git push","fromName":"Peter Harris","fromEmail":"git@peter.is-a-geek.org","sentAt":"2008-08-27T15:52:28Z","receivedAt":"2008-08-27T15:52:28Z","isPatch":false,"sender":{"key":"git@peter.is-a-geek.org","avatar":null},"body":"On Wed, Aug 27, 2008 at 11:37 AM, Eric Bowman wrote:\n> Where things get a weird is when I push a revision back to itchy from one of\n> my other clones.  I feel like I must be missing some fundamental concept,\n> and I'm wondering if someone can help.\n\nThis is a FAQ.\nhttp://git.or.cz/gitwiki/GitFaq#head-b96f48bc9c925074be9f95c0fce69bcece5f6e73\n\n> I'm starting to think that I should clone the repo I cloned from svn for\n> doing development work on itchy, but this seems kind of wasteful.  Am I\n> missing some fundamental concept?\n\nI always clone my svn mirrors for doing development work.\n\nIt's not particularly wasteful, especially if you set up the svn\nmirror as an alternate for your working repo. (\"git clone -s\", but\nmake sure you read \"git help clone\" so that you know why you can't\ndelete anything from the svn mirror)\n\nPeter Harris\n"},{"id":"88731","messageId":"g93u19$b0u$1@ger.gmane.org","threadId":"15219","inReplyTo":"48B574B0.4030607@boboco.ie","subject":"Re: newbie question about git push","fromName":"Michael J Gruber","fromEmail":"michaeljgruber+gmane@fastmail.fm","sentAt":"2008-08-27T16:06:00Z","receivedAt":"2008-08-27T16:06:00Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Eric Bowman venit, vidit, dixit 27.08.2008 17:37:\n> Hi,\n> \n> Apologies in advance if this has been covered before ... I've been \n> wading through the archives a bit and couldn't find anything that seemed \n> to address this basic question.\n> \n> I have a bunch of machines I use for development, but only one of them \n> is allowed to connect via vpn to where the subversion repository lives, \n> so I'm using git-svn to make things a little easier.\n> \n> I've got one machine, itchy, where I've done a git svn clone operation.  \n> I do a fair amount of development work there, and typically I just work \n> on the master branch, and periodically commit back to svn using git svn \n> dcommit.\n> \n> I've cloned the repository on itchy on a few other machines I \n> occasionally use, and I'm able to push new revisions from itchy with no \n> surprises, and I can pull revisions back to itchy ok with no surprises.\n> \n> Where things get a weird is when I push a revision back to itchy from \n> one of my other clones.  I feel like I must be missing some fundamental \n> concept, and I'm wondering if someone can help.\n> \n> Suppose I make a change on another machine commit that change, then push \n> it back to itchy:\n> \n> git commit -as\n> git push origin master\n> \n> This works ok, and I can then git svn dcommit that change back to the \n> svn.  But I have a hard time getting that change to show up in the \n> sandbox I have on itchy.\n> \n> When I go back to itchy after pushing from a satellite, git thinks that \n> the old revision of the file I modified on another machine, has been \n> modified locally; it doesn't see that the local copy is out of data and \n> this new revision needs to be merged.  But I can't figure out how to get \n> git to do that; the only things that seem to work are fairly drastic \n> measures,  like \"git reset --hard\" or by stashing and then deleting the \n> stash. Either seems terribly error prone.\n> \n> I'm starting to think that I should clone the repo I cloned from svn for \n> doing development work on itchy, but this seems kind of wasteful.  Am I \n> missing some fundamental concept?\n> \n> Many thanks for any thoughts.\n> \n> cheers,\n> Eric\n\nI don't think I understand your situation completely. But could it be\nthat when you push from satellite to itchy you push into a branch which\nis checked out? Most probably, because you seem to push master to\nmaster. You can't merge on push because there may be conflicts.\n\nThat setup is generally not a good idea, for the reasons you've\nexperienced. You may want to pull from itchy instead.\n\nMichael\n"}]}