It is seying that I cannot do this:
git submodule add -f [email protected]:thephpleague/oauth2-server.git libs/OAuth/functions
Because of this:
'libs/OAuth/functions' already exists and is not a valid git repo
I just don't get it. It does not exists anywhere. Is there another git config file hidden on my computer that I don't know of or something? I tried deleting .git and pulling everything again that did not do anything. Any ideas?
I also tried this:
git ls-files --stage functions
When I was inside of libs/OAuth and I got nothing.
Then I tried this:
sudo git rm --cached functions
I got this error:
fatal: pathspec 'functions' did not match any files
I also tried this:
sudo git rm -r --cached functions
And got the same previous error.
To do so, you need to navigate to the correct folder and then run the command git init , which will create a new empty Git repository or reinitialize an existing one.
A Git command needs to be run on a specific repository, so this error typically occurs when a Git command is run in a directory that Git doesn't know about. In these cases, the fix is to make sure that you are both working in the correct folder and that you set up your repository right.
In case someone else had a similar case as mine and was struggling with this as I was because of a stupid reason:
Check if for any reason the file doesn't already exists (I had a failed git subomdule add previously)
So in the context of the question rm the file:
rm -rf libs/OAuth/functions
And then try to re add
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With