1

I made a mistakes and now I can't fix it. I have pushed an useless directory in my github repository, then I deleted it and repush the new version of my project. The problem is that the directory is still here in github WebUI but not when I pull (already up to date, and my local project doesn't have the useless directory).

This is a screenshot of my github web interface

enter image description here

The dir is l3miage-bdsi-G01 Thanks

Vy Do
  • 46,709
  • 59
  • 215
  • 313
Shining
  • 425
  • 6
  • 20

4 Answers4

1

it seems what you have there is a git submodule

This question may help you: How do I remove a submodule?

Community
  • 1
  • 1
pedrorijo91
  • 7,635
  • 9
  • 44
  • 82
0

Try to remove commit and push it to repo with -f command line option. This way is not good becouse somebody may be alredy make work from before pushed commits but this command remove that.

Try to do:

git checkout master
git reset --hard commit
git push --force origin master:master

If there is no help. Possible git repo broken some how. It is rare case seems impossible. If git repo broken it is need to delete repo and recreate and push again.

Community
  • 1
  • 1
oklas
  • 7,935
  • 2
  • 26
  • 42
  • I have tryied there solutions before posting this question. I will try to remove the commit. – Shining Jan 14 '17 at 11:24
  • when I push the new project after reseting at the good commit > fatal: 8b9162ed6fe8ffd792d065792d19fccafd648401 cannot be resolved to branch. – Shining Jan 14 '17 at 11:32
0

Try cloning the project and see if that directory is there in cloned project or not. If the directory is not in cloned project then it must not be in git either. If the directory is still there then delete directory using 'git rm -r directory_name' command. In either case, add that directory to .gitignore file to make sure this directory is not pushed.

Prakash Sharma
  • 15,542
  • 6
  • 30
  • 37
  • when I clone my project the directory is not here. that why I ask for help ! – Shining Jan 14 '17 at 11:23
  • I used git reset at the good commit and pull the new project > the dir was here. but when I use git rm then repush that doesn't work. – Shining Jan 14 '17 at 11:38
-1

I don't know how I solved this problem but it's okay. I have just git rm the folder, git commit and push. but I have reset lot of think before with lot of commands so I don't realy know the solution (I did this commands before whitout success).

Shining
  • 425
  • 6
  • 20