git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git push rejected due being behind after git svn dcommit without any changes local/remote
@ 2014-05-21 16:13 Henning Sprang
  2014-05-21 21:33 ` Thomas Ferris Nicolaisen
  0 siblings, 1 reply; 3+ messages in thread
From: Henning Sprang @ 2014-05-21 16:13 UTC (permalink / raw)
  To: git

Hi,

I have a client that still uses svn, but I decided to version my work
on the project with git locally - using git svn to sync the svn and my
local git repo.

To have a backup , I additionally push my changes to a remote git repository.

Now, many(maybe every) times when doing the git push to the remote git
repository, after having done an svn dcommit to sync to the remote
svn, the push gets rejected:

"... Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart...."

You'd say, can happen, when some developers work against the remote
git repo, others with svn. But I'm the only developer on the project,
and no one ever commits to the remote svn nor the remote git repo. So,
I'm clueless.

How can I find out what happens and how to prevent that?

Thanks in advance,
Henning

-- 
Henning Sprang
http://www.sprang.de

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

* Re: git push rejected due being behind after git svn dcommit without any changes local/remote
  2014-05-21 16:13 git push rejected due being behind after git svn dcommit without any changes local/remote Henning Sprang
@ 2014-05-21 21:33 ` Thomas Ferris Nicolaisen
  2014-05-23 10:14   ` Henning Sprang
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Ferris Nicolaisen @ 2014-05-21 21:33 UTC (permalink / raw)
  To: Henning Sprang; +Cc: git@vger.kernel.org

On Wed, May 21, 2014 at 6:13 PM, Henning Sprang
<henning.sprang@gmail.com> wrote:
>
> You'd say, can happen, when some developers work against the remote
> git repo, others with svn. But I'm the only developer on the project,
> and no one ever commits to the remote svn nor the remote git repo. So,
> I'm clueless.
>
> How can I find out what happens and how to prevent that?
>

This is normal. Every time you update or sync against the SVN server,
your local history is rewritten if you have local commits: All your
local commits are rebased on top of the latest changes coming from
SVN.

If you want to avoid this, only push to your Git mirror when your
git-svn clone and the SVN repo are in sync. Doing so ruins the whole
point of your Git mirror, I assume.

So, I'm afraid you have to get used to just force-pushing to your Git
mirror. Even though this is not considered good practice, it should be
fine as long as you are the only one using this mirror.

Alternatively, you could consider some other mechanism for backup (rsync, etc).

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

* Re: git push rejected due being behind after git svn dcommit without any changes local/remote
  2014-05-21 21:33 ` Thomas Ferris Nicolaisen
@ 2014-05-23 10:14   ` Henning Sprang
  0 siblings, 0 replies; 3+ messages in thread
From: Henning Sprang @ 2014-05-23 10:14 UTC (permalink / raw)
  To: git@vger.kernel.org

Hi Thomas,

On Wed, May 21, 2014 at 10:33 PM, Thomas Ferris Nicolaisen
<tfnico@gmail.com> wrote:
> This is normal. Every time you update or sync against the SVN server,
> your local history is rewritten if you have local commits: All your
> local commits are rebased on top of the latest changes coming from
> SVN.
>
> If you want to avoid this, only push to your Git mirror when your
> git-svn clone and the SVN repo are in sync. Doing so ruins the whole
> point of your Git mirror, I assume.

Thanks for the explanation so far!

> So, I'm afraid you have to get used to just force-pushing to your Git
> mirror. Even though this is not considered good practice, it should be
> fine as long as you are the only one using this mirror.

OK, as you correctly assume, for this case it's pretty much fine, I
was just thinking I'm doing something stupid, and wanted to learn how
to do it correctly in case I'll have an actual use case where changes
appear on both sides - but then again, maybe that should then also be
avoided by a more reasonable versioning setup(e.g. throwing out SVN
completely :) )

> Alternatively, you could consider some other mechanism for backup (rsync, etc).

I do anyway. I just love to have multiple backups in multiple
locations and formats, just to see them all fail differently in a real
emergency case :)

Cheers,
Henning


-- 
Henning Sprang
http://www.sprang.de

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

end of thread, other threads:[~2014-05-23 10:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-21 16:13 git push rejected due being behind after git svn dcommit without any changes local/remote Henning Sprang
2014-05-21 21:33 ` Thomas Ferris Nicolaisen
2014-05-23 10:14   ` Henning Sprang

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).