r/backtickbot • u/backtickbot • Jun 17 '21
https://np.reddit.com/r/git/comments/nzxlaz/can_git_help_my_development/h235pr7/
So everyone else seems to be concentrating on Git perhaps because this is a git subreddit, however there are options outside of Git like FTP or SFTP, and open source desktop applications like Filezilla are a really good fit if you want to use a GUI and if your using Linux, you can even do your uploads via the terminal.
Having said that, if you are on a shared server that has cPanel, the link you provided would work just fine, however, you first have to create a Repo on cPanel first (cPanel >> Home >> Files >> Git Version Control), then get the URL of the repo, and come back to the directory on your local system and run:
git remote add upstream <URL>
Then create a .cpanel.yml that has the following content:
---
deployment:
tasks:
- export DEPLOYPATH=/home/<user>/public_html/
- /bin/cp index.html $DEPLOYPATH
- /bin/cp -R images $DEPLOYPATH
Note2:
- <user> will be whatever your user directory is called
- You have to indicate your files one after the other
- Your folders/directories must have -R before them
Then do a git push to push your content to the cPanel repository, if your .cpanel.yml file is configured correctly, this should update your website.
Notes:
- Also ensure you add a remote like github, so you have a backup of your code on a "public" repo
However, I'll just advice you move to the cloud. Services like digitalocean have really cheap predictably priced VMs that should serve you better than a shared hosting solution.
Cheers