2

I end up moving my git repo to another directory and also the change directory of all my files.

Now when I add file to index and commit it, it acts as if it is committing a new file and not committing the difference. Eventhough when I pull up the history in Git Extension, all the history is there, and the most recent commit is still appending to the master as if nothing ever happen.

Probably I don't know enough how git to works that it is how it's suppose to work? Suggestions? or anyone need me to clarify?

MCHam
  • 319
  • 1
  • 2
  • 10

1 Answers1

0

Don't forget that Git performs rename detection using a heuristic

That means, as I explained in "git status shows rename but it's incorrect", that:

  • a git add alone might consider the file added to the index a "new" file
  • but a git commit should reconcile the state of that file, and display it as being moved.

So check (when you are ready to commit) the output of a git commit, to see if the "new" file status persists.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • after I did "git status" than "git comment". I get a bunch of "Changes not staged for commit" showing a files "deleted" which are all files that was in the old directory. Under "Untracked files:" are my files after the files that are moved into the new directory. – MCHam Nov 18 '14 at 18:42
  • You need to add everything before committing: `git add -A .` (http://stackoverflow.com/q/572549/6309), before git commit -m "move files"`. Then the `git status` should reflect the moves. – VonC Nov 18 '14 at 18:58