"hg commit" - nothing happens!
Asked Answered
H

2

13

I just started my first Mercurial project.

I did a 'cd' into my source directory.

Then I did this:

hg init myproject

But next I did

hg commit -m "first commit"

And all it reports is:

nothing changed

But when I do

hg status

It lists all of the source code in my project.

What am I doing wrong here?

Hotchpotch answered 9/9, 2009 at 3:10 Comment(1)
Just out of curiousity, were you trying to follow along with this section of "Mercurial: The Definitive Guide": hgbook.red-bean.com/read/… ?Hakim
H
24

I think the output of the hg status command is probably telling you that you have a lot of files in your working directory that are not being tracked by Mercurial. You should be able to fix this by running the command

hg addremove

Then you can make your first commit:

hg commit -m "first commit"

Alternatively, you can do this all in one command with

hg commit -A -m "first commit"
Hakim answered 9/9, 2009 at 3:14 Comment(4)
'hg addremove' is easier to use as the project grows.Krimmer
'hg addremove' is probably a better choice in this case, too, so I have edited my answer to reflect that.Hakim
also 'commit -A' does an automatic add/remove.Brougham
What does addremove do? is it the same as add, then remove -A?Almost
M
-1

Try hg push then refresh the repository some times It changes inspite of saying nothing changed

Maudmaude answered 11/12, 2019 at 16:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.