gh-pages-deploy icon indicating copy to clipboard operation
gh-pages-deploy copied to clipboard

have to `git push origin master` first before `gh-pages-deploy`

Open max-mapper opened this issue 11 years ago • 10 comments

git reset --hard origin/master will only work if you did git push origin master on master before running gh-pages-deploy. it would be nice to either find a way to not rely on origin/master in this way or to at least detect that master has unpushed commits and warn the user about it maybe

max-mapper avatar Oct 20 '14 11:10 max-mapper

I think detecting might be the best route for now, the case you describe is the only one that has caused it to fail and leave me in the gh-pages branch. like in #6.

meandavejustice avatar Oct 20 '14 19:10 meandavejustice

It may also make sense to not be tied specifically to master. Though the common practice is to use master as your main/pure branch not everyone does this. It might be worth it to allow a "main branch to pull from" to either be specified in the package.json config object, or allow it to be based in as a cl option. Then just default to master if nothing is specified.

meandavejustice avatar Oct 20 '14 23:10 meandavejustice

I think it makes more sense to do git stash before changing branches etc, then do git stash pop last

kumavis avatar May 28 '15 22:05 kumavis

otherwise you lose your work

kumavis avatar May 28 '15 22:05 kumavis

How about failing if you have a modified working directory?

On Thu, May 28, 2015 at 3:36 PM, kumavis [email protected] wrote:

otherwise you lose your work

— Reply to this email directly or view it on GitHub https://github.com/meandavejustice/gh-pages-deploy/issues/7#issuecomment-106619241 .

max-mapper avatar May 28 '15 23:05 max-mapper

@kumavis @maxogden I think I like letting the user take care of their own changes by notifying and failing on a modified working directory.

meandavejustice avatar May 30 '15 21:05 meandavejustice

maybe the technique used in this module is relevant https://www.npmjs.com/package/odb

On Sat, May 30, 2015 at 2:38 PM, Dave Justice [email protected] wrote:

@kumavis https://github.com/kumavis @maxogden https://github.com/maxogden I think I like letting the user take care of their own changes by notifying and failing on a modified working directory.

— Reply to this email directly or view it on GitHub https://github.com/meandavejustice/gh-pages-deploy/issues/7#issuecomment-107090555 .

max-mapper avatar May 30 '15 21:05 max-mapper

heh nice.

kumavis avatar May 30 '15 22:05 kumavis

i fixed this issue like so:

"deploy": "git push origin master && gh-pages-deploy"

but failing on un-merged/un-pushed work would be better. Would you accept a PR that did such a thing? I would be happy to take a crack at it.

coleww avatar Aug 09 '15 23:08 coleww

hey @coleww I seem to have missed this comment(sorry!). I would definitely except a PR.

meandavejustice avatar Mar 02 '16 02:03 meandavejustice