1

i ran into a typical situation. I already have a cloned repo in my local. and i have a path /src/main/resources

my goal was to create a directory inside resources and name it scripts and add some files into that folder. what i did was i created a folder and copied the files but when adding these items to github i added only the files and forgot to add the folders. i created myself a pull request and merged it to develop.

now this whole set of files are not visible in the remote repo. also in local if i now go to src/main/resources/scripts and do git add . nothing is happening.

please help me how to recover from this situation.

2 Answers 2

2

You don't add folders with Git, only files (which are in folders).

Check first how many .git subfolder you have:

cd /path/to/local/repo
find . -type d -name ".git"

That will detect if you have any nested repository.

And do a git status in /src, and /src/main/resources (assuming here that /src means actually /path/to/local/repository/src)

Sign up to request clarification or add additional context in comments.

Comments

0

Empty directories or folders cannot be committed. That is why the empty directory you created was not visible in the remote.

You should either add a .gitignore or a .gitkeep inside the empty directory to be able to commit and view that in the remote.

How can I add an empty directory to a Git repository?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.