0

SOS! SOS!

After a good day of work and testing out everything, I committed my work. Except, this time, instead of

git commit -u

I used

git commit -A

because I was fed up of the untracked files alert I was getting about some of the zend files like doctrine, composer etc. And boom! the project has stopped loading.

I tried going back in my log, hoping that a previous commit should work, but nothing is working.

My question is: 1. How to remove the zend files from the commit 2. How to clean this mess?

Please help!

rednivlat
  • 135
  • 2
  • 2
  • 11
  • Dupe http://stackoverflow.com/questions/927358/undo-the-last-git-commit – Andrew C Oct 09 '14 at 00:19
  • Ok. So got over my panic and did a soft reset, removed the zend files from the commit and committed again with good files. And now, I am facing a different issue - zend is throwing an exception as shown in the image below. The project was working flawlessly until this happened. [screenshot](https://www.dropbox.com/s/hx53s9967akpnbv/Screenshot%202014-10-09%2005.55.33.png?dl=0) – rednivlat Oct 09 '14 at 00:24

1 Answers1

0

The world is beautiful again.

Sharing the stack of mistakes I did, so that it may help someone someday:

  1. Committed zend framework files with the project files. Specially the vendor ones. NEVER do that. .gitignore them
  2. After committing, when I moved to a previous branch, the project started throwing 500, because it was not able to find all the zend files. (git was trying to reset the files to the previous stage and I presume there was a mismatch in the zend framework files)
  3. I added another blunder to this sequence by doing a php composer.phar install in the zend folder, expecting that the missing files will be regenerated.

Solution:
1. Did a soft reset: git reset --soft HEAD~3 to go back to a stable commit
2. Removed all zend files
3. Recommitted the desired files
4. This is when I started getting badmethodcall from zend/navigation/navigation. This was because composer install, loaded zendframework folder in the vendor folder in addition to ZF2 folder. There should be only one shared library folder in the vendor folder. Now, why was zendframework taking precedence over ZF2 with regard to rendering the menu - I have no clue. But I deleted the zendframework, and butterflies started singing.

Thanks to anyone who tried to help me.

rednivlat
  • 135
  • 2
  • 2
  • 11