0

When creating a repository for a React project that should include frontend and backend, git doesn't allow me to add frontend folder.

This is the message:

error: 'frontend/' does not have a commit checked out fatal: adding files failed

Any clue of what can I try to solve it?

4
  • With-out seeing more of your project it's difficult to help. Do you have a gitignore file? Can you please add the steps how you created your project, so it is possible to re-create your issue? Commented Mar 27, 2020 at 23:29
  • Is frontend a git repository by itself? Does it have frontend/.git/? Commented Mar 28, 2020 at 6:48
  • It's a project created direct with react, it contains already a .gitignore that I haven't touched it. But besides that I don't see a .git . Should I create this? I don't understand the question, sorry, I'm kind of new to it, but have already worked with git in several other projects and never got this error. It just happens when I do a react project, specific with the frontend folder Commented Mar 28, 2020 at 9:16
  • Backend and frontend supposed to be in the same repo, not in separate ones. Frontend didn't have a separate repo, it was local on my machine, and I dragged it into the repo folder. Than I tried to do the same as I did for the backend: git add . / git commit -m "message"/ git push. But with frontend it desn't allow me to do git add. Commented Mar 28, 2020 at 9:38

1 Answer 1

2

Problem solved!

It had indeed create automatically a new repo/ subrepo... a .git file, but it was invisible. I asked to removed it anyway with: "rm -rf .git" inside of my frontend folder and it worked.

thank you all for your help!

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

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.