git commit -m not working

I have been committing to my local repository today with git commit -a and entering my commit messages. Everything fine.

At the end of the day I wanted to commit a small change with a single line commit, so I used git commit -m "some message" and got the following:

  • Single git repo setup tracking multiple locations on hard drive
  • Reparent a git commit to have two parents, consolidating a number of branches, and preserving future merge history
  • Fatal error on “git add submodule”
  • Split a git repository to work on two projects at the same time
  • Powershell displays some git command results as error in console even though operation was successful
  • Why branch when I have master locally?
  • On branch ChartFeature
    Your branch is ahead of 'origin/ChartFeature' by 2 commits.
      (use "git push" to publish your local commits)
    Changes not staged for commit:
            modified:   SomeFolder/Scripts/app/SomeScript.js
    no changes added to commit

    What have I done wrong?

    How do I get git to allow commit -m again?

    Footnote: After failing with -m a few times and seeing nothing wrong with git log origin/ChartFeature..HEAD I tried git commit -a as before and it worked (as expected) though git commit -m still does not.

  • Access Git repo via SSH tunnel
  • How do I re-add a file to my git repo that was previously being ignored and won't show up now?
  • Heroku Create Command Yielding “ENOENT” Error
  • Reset or revert a specific file to a specific revision using Git?
  • What exactly does the ReCommit feature in TortoiseGit do?
  • git submodule update is slow. How can I debug why it's slow?
  • 5 Solutions collect form web for “git commit -m not working”

    git commit -m 

    does only work when you did a git add something before!

    That is all there is to that! In other words: you haven’t added (staged) anything; thus you can’t make a commit!

    git -a

    adds (certain) types of changes automatically; -m does not!

    Your status messages tells you:

    Changes not staged for commit:
    modified: SomeFolder/Scripts/app/SomeScript.js

    Probably you need to merge ‘origin/ChartFeature’ before you push any changes.

    Follow this steps

    First, add all changes by using

    git add -A

    Then commit your changes

    git commit -m “message”

    Before doing push on the branch just pull once this will merge your code with the remote branch. If you want to review this code before merge then you can use git fetch

    git pull origin the branch

    then push the changes on the respective branch

    git push origin the branch

    First you need to add the modified files:

    git add SomeFolder/Scripts/app/SomeScript.js

    and then use :

    git commit -m"Some message"

    and then

    git push origin <the branch>

    First add the modified files to git using any of the following:-

    git add -A stages All

    git add . stages new and modified, without deleted

    git add -u stages modified and deleted, without new

    I will prefer git add -A.

    then try to commit, it will work

    Changes not staged for commit:

    You need to Add first then do Commit.

    $ git commit -am 'Message'   # add & commit 
    Git Baby is a git and github fan, let's start git clone.