I have a wordpress website on hostinger and im trying use version control Git on it without downloading the files locally but i have no idea what to do or where to start ! my goal would be pushing to github as if im working locally (but im not the files are on the server and i dont want to download them ) please Help.
2
Answers
Good day.
Unfortunately you can not push at once from hostinger to Github.
I have 7 steps for you to push all code to the GIT server:
1)Install github locally
Download github
2)Copy the files of your website to local directory
3)Open cmd.exe on windows follow to your catalog with Website files and run next command to initialize new git repository locally
4)Add files to your locall repo
5)Add commit
6)Create remote repo link for your website on github.com and copy link to the next command(replace CAPS)
7)Push all files to Github
You need to initiate a git repo for the files on a server and add a GitHub repo as the remote for this. Then you can push files from your Hostinger server to GitHub. To do this, you will ideally need SSH access to your hosting. This seems possible with Hostinger depending on your hosting plan. See how to login to hostinger account via SSH.
Once you’ve logged into your hosting account via SSH:
cd /path/to/folder
git init
git add .
git commit -m "Commit message"
git remote add origin [email protected]:username/repo-name.git
git push origin main
orgit push origin master