Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git: file "changed but not updated"

Tags:

git

What does "Changed but not updated mean"? These files are in git, they've been modified but when I run "git status," these changes appear under "Changed but not updated" instead of "Changes to be commited."

# On branch master # Changes to be committed: #   (use "git reset HEAD <file>..." to unstage) # # modified:   breakouts/views.py # # Changed but not updated: #   (use "git add <file>..." to update what will be committed) #   (use "git checkout -- <file>..." to discard changes in working directory) # # modified:   templates/registration/login.html # modified:   templates/registration/registration.html  # Untracked files: #   (use "git add <file>..." to include in what will be committed) # # context_processors.py # static/#css.css# 

Since they've already been added why aren't they "Changes to committed"?

like image 433
Nate Reed Avatar asked Jan 27 '11 02:01

Nate Reed


People also ask

When running git reset the affected files will change state?

Comparatively, git reset , moves both the HEAD and branch refs to the specified commit. In addition to updating the commit ref pointers, git reset will modify the state of the three trees. The ref pointer modification always happens and is an update to the third tree, the Commit tree.

Why git add is taking forever?

Git slowness is generally from large binary files. This isn't because they're binary, just because binary files tend to be large and more complex to compress & diff. Based on your edit indicating the file sizes, I suspect this is your problem.


2 Answers

You have to use git add every time OR use git commit -a or git commit --all instead of plain git commit.

from Git docs:

 -a --all   Tell the command to automatically stage files that have been modified   and deleted, but new files you have not told git about are not affected. 

add is basically the "take notice of this file/directory" command. Not CVS's or subversion's track changes to this file.

like image 152
KitsuneYMG Avatar answered Oct 06 '22 01:10

KitsuneYMG


Every time you modify a file, you have to add it using git add to be able to commit it, even if you did add it at the beginning.

like image 28
Simon Avatar answered Oct 06 '22 00:10

Simon