Skip to contentSkip to conversation

Confusion using git on svn server

DISCUSSION Matthieu Stigler 2 participants 5 messages Jun 15, 2016 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

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!

#1 lore raw

* Matthieu Stigler:

Quoted 3 lines

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.

#2 lore raw
Quoted 8 lines · Florian Weimer

* Matthieu Stigler:

Quoted 4 lines

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.

Quoted 9 lines

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 [email protected]
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!

#3 lore raw

* Matthieu Stigler:

Quoted 3 lines

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.

A message that is not in the archive (sent off-list or not yet received): [email protected]

#5 lore raw

* Sverre Rabbelier:

Quoted 2 lines

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.