-1

I locally stripped a few commits that I had already pushed. I could see that locally I was back to where I wanted to be and that I had removed the undesirable commits. So, I continued working and made some changes, but after I commited and now that I wanna push my changes, I get a message about pushing two heads...

At least locally, I only see one head on my branch, so I just wanna push my changes without any problems.

Is there any way to do this cleanly?

  • 1
    There is no such thing as "pulling a strip": pull means *add commits to my repository*, always. At most, it adds zero commits, so that you have nothing new. – torek Apr 08 '20 at 17:53
  • 1
    The message about two heads is because it can see that your push would in fact create a second head, even though you don't currently have that other head locally. – StayOnTarget Apr 08 '20 at 20:13

1 Answers1

1

First of all you want to pull all the changes from the remote repo. This will show you what the actual state is.

If you previously stripped public changesets (something you should not really do), these will come back.

It may be that you just you need to rebase your changes:

See this answer for how to do that in thg:

How to rebase in tortoisehg?

Tom
  • 6,325
  • 4
  • 31
  • 55
  • 1
    Thanks for your answer. I noticed that when I pulled (before pushing) those stripped changes were queued up in hg incoming, so I panicked and thought pulling would undo my strips. It is at that point that I posted this question. So, you are saying that even though my strips were done locally, in order to effect them (force them) onto the remote, I should still pull first and then push? Do I have to update after pulling or merge wil local? Basically, how do I force my local strips onto the remote for everyone to pull afterward? –  Apr 08 '20 at 16:18
  • 2
    In order to remove changes sets on the remove server, you would have to run the strip's on the actual remote server. Normally this isn't something that is done, as other people could have already pulled these changes, and they will keep coming back. In general you need to deal with the problem without striping public changesets. This can be done via the 'backout' command. – Tom Apr 08 '20 at 16:20
  • 3
    @MaryJane Yes, pulling will undo your local strip. It is not possible to propagate the effect of a strip through a push. – StayOnTarget Apr 08 '20 at 20:12