Mobile app version of vmapp.org
Login or Join
Chiappetta492

: How do I set up WHM/cPanel to back up to GitHub? I've been motivated to start using GitHub because a potential employer wants to see my source code, but I'm finding the process of committing

@Chiappetta492

Posted in: #Backups #Git #Github

I've been motivated to start using GitHub because a potential employer wants to see my source code, but I'm finding the process of committing the files manually from my computer after downloading them to be a bit inefficient. Is it possible to have git running on my VPS to periodically or by command push select directories to a git repository?

I'm running WHM 11.52.2 on CentOS 6.7.

Alternatively, can anyone recommend a decent workflow for keeping live, local and remote backups in sync (without having multiple local copies)?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Chiappetta492

1 Comments

Sorted by latest first Latest Oldest Best

 

@Heady270

The solution is to put everything on your website into git. Modify the files locally on your home machine. When you are ready to publish, push them to github and push them to your website over ssh. Here is a tutorial that walks you through cloning your git repository over SSH: www.siteground.com/tutorials/siteground-git/clone-git-repository.htm
The only caveat is that if you have sensitive data (like passwords) in any of your code, you will need to remove them before moving everything to git. I usually store passwords in configuration files outside of the git repository and have the code read them from a known location.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme