2

I did kind of a bad thing on my branch, and now it's a bit messed up.

I am developing a magento extension, and I accidentally commited some core files, and some folders similar to .idea to github.

What I want to do now is to remove these files from git, and keep them on my local branch. I tried the following (but didn't work):

git rm -rf --cache .idea
git add -A
git commit -m "remove unnecessary files"
git push origin blog

But it had no effect.

PS: In the meantime, I did a lot of useful commits, so reverting would be ... unpleasant :)

Thank you

Vlad Preda
  • 9,780
  • 7
  • 36
  • 63

2 Answers2

2

removing the files seems to already have been answered here: Completely remove files from Git repo and remote on GitHub

to prevent those files from being uploaded again while keeping them locally push a different branch to git that doesn't contain your secret files. :)

Community
  • 1
  • 1
Gung Foo
  • 13,392
  • 5
  • 31
  • 39
2

Your git add -A command added back all files you unstaged. If you always checked the diff before committing you would notice this.

wRAR
  • 25,009
  • 4
  • 84
  • 97