What does “Changes not staged for commit” mean

前端 未结 9 1975
再見小時候
再見小時候 2021-01-29 17:17

I thought if you want to track the files you should git add [files you want to track]

I don\'t know why I got the messages Changes not staged for com

相关标签:
9条回答
  • 2021-01-29 17:48

    What worked for me was to go to the root folder, where .git/ is. I was inside one the child folders and got there error.

    0 讨论(0)
  • 2021-01-29 17:51

    Try following int git bash

    1.git add -u :/

    2.git commit -m "your commit message"

    1. git push -u origin master

    Note:if you have not initialized your repo.

    First of all

    git init 
    

    and follow above mentioned steps in order. This worked for me

    0 讨论(0)
  • 2021-01-29 18:01

    It's another way of Git telling you:

    Hey, I see you made some changes, but keep in mind that when you write pages to my history, those changes won't be in these pages.

    Changes to files are not staged if you do not explicitly git add them (and this makes sense).

    So when you git commit, those changes won't be added since they are not staged. If you want to commit them, you have to stage them first (ie. git add).

    0 讨论(0)
  • 2021-01-29 18:02

    Follow the steps below:

    1- git stash
    2- git add .
    3- git commit -m "your commit message"

    0 讨论(0)
  • 2021-01-29 18:03

    You may see this error when you have added a new file to your code and you're now trying to commit the code without staging(adding) it.

    To overcome this, you may first add the file by using git add (git add your_file_name.py) and then committing the changes (git commit -m "Rename Files" -m "Sample script to rename files as you like")

    0 讨论(0)
  • 2021-01-29 18:05

    You have to use git add to stage them, or they won't commit. Take it that it informs git which are the changes you want to commit.

    git add -u :/ adds all modified file changes to the stage git add * :/ adds modified and any new files (that's not gitignore'ed) to the stage

    0 讨论(0)
提交回复
热议问题