I am using a VM (homestead/laravel) to try to create a templated repository.
However although it all seemingly works fine but when it gets to pushing it never seems to recognize the remote.
fatal: No such remote 'origin'
fatal: 'origin' does not appear to be a git repository
fatal: Could not read from remote repository.
The above are the 2 errors I typically get.
I have tried a few commands to set the remote.
git remote add origin https:://url.git - does not add the remote (checked git config)
git remote set-url origin https:://url.git - does not add the remote (checked git config)
git config remote.origin.url https:://url.git - sets url, but still does not work.
These are private repos, and I am using https with the user:pass to handle it since I cannot easily manage ssh keys with this setup (in other words I am forced to use HTTPS in this way).
After trying the commands through php I navigate to the directory in ssh and run the push. Works fine (if I use the third option above). I have used exec and https://github.com/kbjr/Git.php but both end up having the same issue.
Git version is: 2.7.2
PHP version is: 7.1.0
The only thought I have is that technically there is a git repo above the one generated. I am creating the repo in a temp folder in laravel and then generating the "template" before pushing it to a repo I create during the process (github api). Once its all done I delete it locally. However I don't see any errors that could be related to problems caused by "a repo under a repo"
pwdto confirm u r working on properly directory?echo shell_exec("cd /var/www/git-repo && /full/path/to/bin/git pull 2>&1");will output?.shbut "Git.php" uses them individually as well though it usesproc_open