Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can changes made by strip be reflected in the public repo?

Let's say I have this:

hg clone public_repo my_repo
touch a b c d
hg add .
hg commit -m a a
hg commit -m b b
hg commit -m c c
hg commit -m d d
hg push
# let's say revX is the revision that added a 
hg strip revX

In my repository's history, the commits are gone. However, if I try to do a push after the strip, it tells me no changes found. Can the strip be applied to the public repo?

EDIT: the question is just hypothetical :). I am not in this situation, I just thought it would be interesting to find out how this works.

like image 906
Geo Avatar asked Aug 09 '11 17:08

Geo


People also ask

What is hg amend?

hg amend [OPTION]... [ FILE]... aliases: refresh. combine a changeset with updates and replace it with a new one. Commits a new changeset incorporating both the changes to the given files and all the changes from the current parent changeset into the repository.

What does hg rollback do?

If you want to revert just the latest commit use: hg strip --keep -r . Using strip will revert the state of your files to the specified commit but you will have them as pending changes, so you can apply them together with your file to a new commit.

How do I revert a commit in TortoiseHg?

In the TortoiseHg client's Commit dialog, right-click the needed file and then click Revert.

What is hg revert?

hg revert changes the file content only and leaves the working copy parent revision alone.


1 Answers

You need to run hg strip there. If it's bitbucket repo, you can do it from the admin panel. If not, SSH.

like image 99
Cat Plus Plus Avatar answered Sep 30 '22 02:09

Cat Plus Plus