Search code examples
gitmacosmercurial

Git equivalent of Mercurial "hg commit -A -m <message>"


Recently I heard the news about BitBucket ending support for Mercurial so I'm making the switch to Git. It's just a one person repository that I basically use to back up my project and to have as a resource for old code (I don't do anything tricky at all). So I've gotten by all these years by simply using hg commit -A -m <message> to commit the entire project whenever I've made a significant amount of changes.

Now that I've made the switch to Git, I was wondering if someone could tell me the equivalent command to accomplish the same? I know there's git commit -a -m <message> but this gives me an odd message "nothing added to commit but untracked files present" which leaves me a little uncertain.

So I wanted to ask here, what command / commands would accomplish the same as the Mercurial command hg commit -A -m <message> ?


Solution

  • The warning message you're seeing ("nothing added to commit but untracked files present") indicates that your files are untracked.

    You must alert git to track changes to these files; accomplished using the git add <filename>.
    To track all files, use the git add * wildcard file specifier.

    From this point onwards, subsequent changes can be staged and committed using your specified command (git commit -a -m <message>).