{"thread":{"id":"36724","subject":"git push rejected due being behind after git svn dcommit without any changes local/remote","startedAt":"2014-05-21T16:13:18Z","lastAt":"2014-05-23T10:14:04Z","messageCount":3,"participants":["Henning Sprang","Thomas Ferris Nicolaisen"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"242384","messageId":"CAB10+LtnAiCCiMdrULvioxc-UBQufKD4AzOphvE8bAdq7en04g@mail.gmail.com","threadId":"36724","inReplyTo":null,"subject":"git push rejected due being behind after git svn dcommit without any changes local/remote","fromName":"Henning Sprang","fromEmail":"henning.sprang@gmail.com","sentAt":"2014-05-21T16:13:18Z","receivedAt":"2014-05-21T16:13:18Z","isPatch":false,"sender":{"key":"henning.sprang@gmail.com","avatar":null},"body":"Hi,\n\nI have a client that still uses svn, but I decided to version my work\non the project with git locally - using git svn to sync the svn and my\nlocal git repo.\n\nTo have a backup , I additionally push my changes to a remote git repository.\n\nNow, many(maybe every) times when doing the git push to the remote git\nrepository, after having done an svn dcommit to sync to the remote\nsvn, the push gets rejected:\n\n\"... Updates were rejected because the tip of your current branch is behind\nhint: its remote counterpart....\"\n\nYou'd say, can happen, when some developers work against the remote\ngit repo, others with svn. But I'm the only developer on the project,\nand no one ever commits to the remote svn nor the remote git repo. So,\nI'm clueless.\n\nHow can I find out what happens and how to prevent that?\n\nThanks in advance,\nHenning\n\n-- \nHenning Sprang\nhttp://www.sprang.de\n"},{"id":"242419","messageId":"CAEcj5uURgU0NfocwSxYDJiQvwdyvDgS3Gvo2kFEroz-dg=U5Tg@mail.gmail.com","threadId":"36724","inReplyTo":"CAB10+LtnAiCCiMdrULvioxc-UBQufKD4AzOphvE8bAdq7en04g@mail.gmail.com","subject":"Re: git push rejected due being behind after git svn dcommit without any changes local/remote","fromName":"Thomas Ferris Nicolaisen","fromEmail":"tfnico@gmail.com","sentAt":"2014-05-21T21:33:21Z","receivedAt":"2014-05-21T21:33:21Z","isPatch":false,"sender":{"key":"tfnico@gmail.com","avatar":"https://gravatar.com/avatar/628cf28a25ca4c596c7284562100f70f0ef908bcbfadd4da1eb3d48c23658d01?d=mp&s=160"},"body":"On Wed, May 21, 2014 at 6:13 PM, Henning Sprang\n<henning.sprang@gmail.com> wrote:\n>\n> You'd say, can happen, when some developers work against the remote\n> git repo, others with svn. But I'm the only developer on the project,\n> and no one ever commits to the remote svn nor the remote git repo. So,\n> I'm clueless.\n>\n> How can I find out what happens and how to prevent that?\n>\n\nThis is normal. Every time you update or sync against the SVN server,\nyour local history is rewritten if you have local commits: All your\nlocal commits are rebased on top of the latest changes coming from\nSVN.\n\nIf you want to avoid this, only push to your Git mirror when your\ngit-svn clone and the SVN repo are in sync. Doing so ruins the whole\npoint of your Git mirror, I assume.\n\nSo, I'm afraid you have to get used to just force-pushing to your Git\nmirror. Even though this is not considered good practice, it should be\nfine as long as you are the only one using this mirror.\n\nAlternatively, you could consider some other mechanism for backup (rsync, etc).\n"},{"id":"242560","messageId":"CAB10+LuaoCHYOew_=_NhF3m++owM9uuQqFvA79e1bTs=YpOCWQ@mail.gmail.com","threadId":"36724","inReplyTo":"CAEcj5uURgU0NfocwSxYDJiQvwdyvDgS3Gvo2kFEroz-dg=U5Tg@mail.gmail.com","subject":"Re: git push rejected due being behind after git svn dcommit without any changes local/remote","fromName":"Henning Sprang","fromEmail":"henning.sprang@gmail.com","sentAt":"2014-05-23T10:14:04Z","receivedAt":"2014-05-23T10:14:04Z","isPatch":false,"sender":{"key":"henning.sprang@gmail.com","avatar":null},"body":"Hi Thomas,\n\nOn Wed, May 21, 2014 at 10:33 PM, Thomas Ferris Nicolaisen\n<tfnico@gmail.com> wrote:\n> This is normal. Every time you update or sync against the SVN server,\n> your local history is rewritten if you have local commits: All your\n> local commits are rebased on top of the latest changes coming from\n> SVN.\n>\n> If you want to avoid this, only push to your Git mirror when your\n> git-svn clone and the SVN repo are in sync. Doing so ruins the whole\n> point of your Git mirror, I assume.\n\nThanks for the explanation so far!\n\n> So, I'm afraid you have to get used to just force-pushing to your Git\n> mirror. Even though this is not considered good practice, it should be\n> fine as long as you are the only one using this mirror.\n\nOK, as you correctly assume, for this case it's pretty much fine, I\nwas just thinking I'm doing something stupid, and wanted to learn how\nto do it correctly in case I'll have an actual use case where changes\nappear on both sides - but then again, maybe that should then also be\navoided by a more reasonable versioning setup(e.g. throwing out SVN\ncompletely :) )\n\n> Alternatively, you could consider some other mechanism for backup (rsync, etc).\n\nI do anyway. I just love to have multiple backups in multiple\nlocations and formats, just to see them all fail differently in a real\nemergency case :)\n\nCheers,\nHenning\n\n\n-- \nHenning Sprang\nhttp://www.sprang.de\n"}]}