Question

Can anyone please tell me why i have the grey icon when i push my files to github ? In side the app directory, there should be models, views , and controllers but in the remote GitHub I can't click in.

enter image description here

Was it helpful?

Solution 2

It looks like you created a submodule, pointing to an unreachable remote location.

See this answer. That icon, when green, will point to the sub module. I'm assuming it's greyed out in your case because the sub module was incorrectly configured.

Given that .gitmodules is not present, it must have been deleted, leaving a sub module without a remote information.

If go into app and type git remote -v you will see where this module is pointing too. This place is currently unreachable.

In a similar scenario, I added a submodule and deleted .gitmodules. The result on GitHub looks like this:

missing sub module

OTHER TIPS

git rm --cached <folder_name>

Then go to the parent directory and do:

git add .
git commit -m "<your_message>"
git push --all

Git thinks it's a submodule as it has a .git directory inside it. To fix...

Changed directory to the offending dir:

cd <offending git submodule>

Remove the .git directory inside it:

rm -rf .git

Update the git cache:

git rm --cached <offending git submodule>

Go to the parent directory:

cd ..

Add the directory to git:

git add .
git commit -m "Changed submodule to directory"
git push --all

It looks like you initialized git inside the folder. Delete the git file (rm -rf) from the subfolder and create a new repo and re initialize git.

You have already initialized git inside the app directory and it can't find the remote. Delete the .git file inside app..

[app(master)]$ sudo rm -r .git

Or show the hidden files inside the folder and do it manually. Then re-commit & re-push the changes of the parent folder

The easiest method I found was simply to remove the folder from local and update the remote repo. Navigate to your local directory and cut the folder containing the incorrectly set up .git subfolder to another location (outside the local repo, eg desktop) so you can correct the issue and copy back in later, then run:

git submodule update

git add --all

git commit --all

git push

This should remove the folder that is greyed out on the remote repo. Then copy the folder back in again in your local files and run the add --all commit --all git push as above, taking care of course first to delete the incorrectly set up .git folder from the subfolder beforehand to avoid the same issue again; to locate this on linux systems use cntrl-h from within the folder to view hidden files in your folders, you'll see a .git folder present in a subfolder that is causing the issue, simply delete that and that should resolve

It already has a .git inside it and hence appears grey. i.e it has git initialized inside it as well.

In my case I had initialized a git repository in the root folder (the one that has manage.py) when deploying to Heroku before setting up a Git repository in the parent folder of the project.

When I then created a new repo in the project's parent folder, the root folder handling the models views and controllers was grayed out. The following worked for me:

  1. Delete parent folder repo
  2. Create new repo without checking "Initialize this repository with a README" since we will be importing the existing repository.
  3. Within your root folder the one with manage.py, do the following :

    git remote add origin "github repo link"

    git push -u origin master

  4. Refresh your Github repo and all your directories should be present
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top