'Updating code on Digital Ocean via GitHub

I have a Django app on Digital Ocean https://chicagocreativesnetwork.com/ which was uploaded via GitHub.

I need to make some changes to the CSS and HTML for this app, which I am doing locally and pushing to my GitHub repository.

How do I get the pushed GitHub updates into my Digital Ocean app?



Solution 1:[1]

How was the app uploaded to your Digital Ocean droplet exactly? Was the repo cloned or forked to the droplet?

Read the Caution at the end first

You could always go into your droplet console move to the directory where your project is in. Then do:

  • git status (to see the state of your repo)
  • then do git fetch (to fetch the changes from your origin to your droplet repo)
  • do a git status again (to see how many steps your droplet is behind your remote repo)

if you see everything is ok and it says you are '1 commit behind master'(if you are changing for the first time after deployment)

  • Go ahead and git pull (with github username and personal access token as password)

  • do a final git status it should now say 'you are up-to date with remote'

CAUTION - do not git push anything from your droplet console into your remote repo even if git status shows files ready to be staged and committed in red. These files are local to the droplet repo and should stay as they are. Any change you make should come from -

  • Local changes pushed to your remote repository
  • Going into your droplet console and Pulling the changes into your droplet repository

The workflow is detailed more clearly in the following comment: https://stackoverflow.com/a/42001608/2155469

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 cmokVnash