threads / discuss / 19878

Confusion using git on svn server

Subject: Confusion using git on svn server

## tl;dr

5 messages between Jun 20, 2009 and Jun 22, 2009.

replies: 4people: 2as markdown or json

Matthieu Stigler· Jun 20, 2009, 20:28 UTC · lore
Hi

I just began using git on a svn file, which seems really nice. I'm for now confused with a git operation, as maybe my mind is still thinking with svn vision.

As I understood, unlike svn, you can make many commit without sending them to the server, and then then sending them in one block with git-svn dcommit (if I'm right, with push if git server).

So two questions: -Where can I find documentation on that? Didn't find mention on it in git user manual or git-svn crash course.

-say I want to know, before doing git-svn dcommit, which commits will be sent, and if this will do a conflict... is there a way to check that before sending the commits?

My main concern is that in my git log, I have a commit and its "revert", will it be sent as two different commits to svn? I would love they are not sent at all as they represent a "neutral" operation.

Thanks a lot!
Florian Weimer· Jun 21, 2009, 07:49 UTC · re: Matthieu Stigler · lore

Re: Confusion using git on svn server

* Matthieu Stigler:
> My main concern is that in my git log, I have a commit and its
> "revert", will it be sent as two different commits to svn? I would
> love they are not sent at all as they represent a "neutral" operation.
They will be sent as a separate commits by default.

You can use "git rebase -i git-svn" to edit your local history before submitting it, though.

Matthieu Stigler· Jun 21, 2009, 09:09 UTC · re: Florian Weimer · lore

Re: Confusion using git on svn server

Florian Weimer a écrit :
Show 17 quoted lines
> * Matthieu Stigler:
>
>   
>> My main concern is that in my git log, I have a commit and its
>> "revert", will it be sent as two different commits to svn? I would
>> love they are not sent at all as they represent a "neutral" operation.
>>     
>
> They will be sent as a separate commits by default.
>
> You can use "git rebase -i git-svn" to edit your local history before
> submitting it, though.
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>   
Excellent! This is exactly what I was looking for, thanks!

I had a minor issue as the commits I wanted to remove (a modif and its revert) were the last one, so I could not remove both in the same time, as said:

However, if you remove everything, the rebase will be aborted.

So I just added a minor third commit in order to remove the two first. Is there a better way to do than this workaround? Something with git rebase --onto (two last?)

Thanks a lot!
Florian Weimer· Jun 21, 2009, 09:32 UTC · re: Matthieu Stigler · lore

Re: Confusion using git on svn server

* Matthieu Stigler:
> So I just added a minor third commit in order to remove the two
> first. Is there a better way to do than this workaround? Something
> with git rebase --onto (two last?)

If you want to remove the last two commits, you can use "git reset HEAD^^". This moves your working copy (and the associated master branch) back in time.

Florian Weimer· Jun 22, 2009, 06:16 UTC · lore

Re: Confusion using git on svn server

* Sverre Rabbelier:
> It moves your tree only if you add --hard, although in case of a reverted
> revert it doesn't matter.

Well, this is part of the checkout/reset confusion. Even without --hard, reset changes where the working tree is located in the history. But it doesn't perform a checkout.

As you said, with a rever, this shouldn't matter.

← back to recent threads