Search code examples
gitpycharm

Commit failed using git


I get the error msg when trying to do a simple commit of 2 files from pycharm

06:11   Commit failed with error
                0 files committed, 1 file failed to commit: pagination
                warning: CRLF will be replaced by LF in static/images/kb-icon-arrow-1.svg.
                The file will have its original line endings in your working directory.

git status outputs the following

$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

    modified:   static/images/kb-icon-arrow-1.svg
    modified:   static/images/kb-icon-arrow-2.svg

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

    modified:   app.yaml
    modified:   pytz/__init__.pyc
    modified:   pytz/exceptions.pyc
    modified:   pytz/tzfile.pyc
    modified:   pytz/tzinfo.pyc

Untracked files:
  (use "git add <file>..." to include in what will be committed)

    .idea/

Solution

  • There should be an actual error after the warning, like (since 'pagination' is not a file being committed)

    Creation of commit message file failed
    

    That was reported before (with a commit message, or a git hook issue), and could be a bug (make sure to upgrade pycharm), but in the meantime, check if a git commit -m "pagination" in command line allows you to get past that particular commit.