1

I connected to my remote repo, added all files using git add . and then git commit -m "initial" and then to push I used git push -u -f origin workingBranch

All files and folders within my project was pushed to my remote repo in BitBucket, except 1. See screenshots. I can't also seem to find a way to check the gitignore file either?

Thank you for any help. enter image description here

enter image description here

enter image description here

EDIT enter image description here

EDIT 2 enter image description here

  • What does the finder image have to do with anything? The "fictional-university-theme" is it's own repo – evolutionxbox Sep 25 '22 at 07:42
  • Git does not push *files*, it pushes *commits*. (A commit then *contains* files, but it's a package deal: you get all the files that are in the commit, and no other files. So inspect the set of files in the commit, e.g., `git ls-tree -r`.) And as @evolutionxbox said, it looks like `ficitonal-university-theme` is a *gitlink*, i.e., a reference to a commit in a separate repository. – torek Sep 25 '22 at 09:24
  • @torek that makes some sense. But I was trying to add all files including the fictional-university-theme folder into the commit as well. I even deleted the old git repo and created a new one in the parent wp-content folder instead to try and accomplish this? – Abdul Samad Sep 25 '22 at 11:52
  • @evolutionxbox but I deleted the old repo from the fictional-university-theme directory? Attached new finder image above with hidden files made visible. – Abdul Samad Sep 25 '22 at 11:54

1 Answers1

1

but I deleted the old repo from the fictional-university-theme directory?

That would not be enough, the gitlink entry might still be registered in the index of the repository.

Try

cd /path/to/repository/themes
# where fictional-university-theme  was

# no trailing / at the end:
git rm --cached -- fictional-university-theme   

git commit -m "fictional-university-theme"

You also need to remove any fictional-university-theme in your repository .gitmodules file.

If you still have the fictional-university-theme folder present, you now can add it, commit it and push it to your repository.

To fully remove a submodule though, the official command is git submodule deinit.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thank you so much. Sadly, this didn't work for me. Can you check my terminal to see if I've done what you asked? Screenshot in original question as EDIT 2 – Abdul Samad Sep 25 '22 at 15:47
  • @AbdulSamad Check if you have a `.gitmodules` file, and remove in it any reference to `fictional-university-theme` – VonC Sep 25 '22 at 16:00
  • I found 1 line in the index file within the git. folder but after I try to added files to comit, it says: error: index uses extension, which we do not understand fatal: index file corrupt I might just try and learn how to do submodules now! :( – Abdul Samad Sep 25 '22 at 16:19
  • @AbdulSamad I have included a link to explain how you would properly remove a submodule. – VonC Sep 25 '22 at 21:01