0

So I have my local computer - where I've updated my (html/js/css) code, github (where I've pushed the updated code already by doing a git add + git commit + git push origin master) and then the server of the actual website which the code is for.

I've connected to the server via the command line terminal. I've already previously cloned the code to the server (by running the command git clone [REPO URL]) while logged in to the server via SSH, so the (un-updated-)files are there.

But now that I've updated the code, and pushed that update to github, how do I now update or push the repo/code/updated-github-code to the server???

I'm currently looking at the terminal with [~]#

^ showing. I tried to git clone [REPO URL] again, but then I get the msg: fatal: destination path 'name of my file' already exists and is not an empty directory

Am I missing or overlooking a step? Well obviously I am but I could use some help please. Like I said I'm trying to update the code to the server so the actual website will reflect the changes I made to the code and so everything is in sync (local code, code pushed to github and hopefully/eventually the code on the server/website).

I am just learning this obviously, so go easy on me (I've spent almost the entire day learning to connect to the server via SSH in terminal)...

Also, feel free to correct my terminology...

Seeeyonnn
  • 315
  • 2
  • 10
  • 19

1 Answers1

1

Pull from github while ssh'd into the server using the link from the github repo "copy to clipboard" button on the web interface. If that doesn't work you could try wiping the repos folder on the server and cloning from scratch. But use that option with caution if downtime is unacceptable for this particular web app.

  • One shouldn't need the link; the OP says the repo is already cloned (so presumably has its remotes already set up). – Oliver Charlesworth Jan 05 '14 at 02:09
  • thanks this worked but I needed to git init first. And also, I was pulling to the wrong directory on my server. Apparently my server uses the public_html folder, so I need to pull to that folder as opposed to the main directory. Is that normal or any thoughts on how to change that? – Seeeyonnn Jan 05 '14 at 02:55
  • @Seeeyonnn Having a specific folder for publicly viewable html is a pretty standard setup, nothing to be alarmed by or concerned with. If you are absolutely set on changing that I recommend you go through some web tutorials on your server stack (if LAMP, theres a ton of info on SO and google search). But again, I see no reason to change it. – Hunter Jones Jan 05 '14 at 04:26