JHU-DataViz-Summer16 / final-project-template

A starting point for final projects
0 stars 0 forks source link

publishing new changes #1

Open mike-bales opened 8 years ago

mike-bales commented 8 years ago

I'm trying to make new changes I've made to my master branch show up in my gh-pages branch. In the README it says:

Every subsequent time you want to publish new changes (after committing them!), these steps become:

git checkout gh-pages git push git checkout master

I tried these three commands but they didn't seem to work. Don't we need to make the changes to the code in the gh-pages branch after we have checked it out before we can push? If thats so how do you recommend doing this? One option would obviously be just to copy and paste from the master branch. When I looked this up on stackoverflow I found the following suggestion. Would this work? Do you recommend this?

git checkout gh-pages      # gets you "on branch gh-pages"
git fetch origin        # gets you up to date with origin
git merge origin/master
cmgiven commented 8 years ago

Yeah, so this is a one-time issue, related to the fact that I had some code on the gh-pages branch at the point at which the class cloned it. The one-time (!) change to make to the steps is to change the second line to git push -f -u origin gh-pages. The -f makes it a force push, overwriting anything that exists on the remote repository.

The code you cite above could potentially get you there, although it's not necessary because you don't care about the changes that currently exist on the gh-pages branch, but the one change you'd need to make would be to change the last line to git merge origin/gh-pages. But you probably don't want to do this.