I spent hours trying to publish my site files to a Github repository via SFTP, as per the documentation instructions, and with no success, it always generates the error below.
If anyone here has done, or still publishes the site in the Github repository with the SSH key and can give me a tutorial on how to do it as well as screenshots to better understand it, I’d appreciate it.
If this no longer works, it would be recommended to pull this information out of the program’s tutorial documents.
Creating a new repo - this is also the referenced “Export Destination” in “Export Settings”. So yes you can export the site to the GitHub repository, but you have to create the repo first. If you create it on the site first you have to clone it and if you create it locally first you need to push it to the remote.
Creating an export script – automating the commands to push updates to the repo to be published on GitHub pages.
So, if you already have the repo created and add the exported site to the folder where the repo is run the following commands (make sure you are in the folder of your repo):
git add -A
git commit -m 'Site update'
git push origin main
OR
git push
If the site is updated with your changes you have done everything correctly. If not go back to step one.
@apowell656, thank you so much, it worked! But…
I will report my case here, it may be of use to someone in the future.
I use, used, Github Desktop, so I had to make some tweaks in Windows so the script could work, I had to remove the github credentials through the Windows control panel.
Control Panel\User Accounts\Credentials Manager
Every time I exported the project it was not published on Github, that’s because Windows used a different user, one already registered in the credentials, so… it was a monstrous waste of time, but I managed, with the help of a friend and a lot of research on the Internet:
1 - Solve the configuration problem on my Windows;
2 - Publish my site on Github repository.