Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to prevent removal of CNAME #179

Closed
travi opened this issue Jun 14, 2017 · 6 comments · Fixed by #533
Closed

unable to prevent removal of CNAME #179

travi opened this issue Jun 14, 2017 · 6 comments · Fixed by #533

Comments

@travi
Copy link

travi commented Jun 14, 2017

I ran across your suggestion to use --remove with negation to prevent removal of specific files when using the cli, but have been unable to get that working.

Is that approach still supported/recommended?

travi added a commit to travi/presentations that referenced this issue Jun 16, 2017
this wont be a good long term solution because of filenames changing each time the contents change,
but the --remove flag isnt working as expected. this should at least prevent the removal of CNAME
with every deploy until i hear back on tschaub/gh-pages#179
@stephenmathieson
Copy link

stephenmathieson commented Aug 16, 2017

Any news here?

As a hack, I've just done this for now:

screen shot 2017-08-15 at 23 16 50

@emschwartz
Copy link

I needed to prevent it from removing a .nojekyll file and made that work by using the config option: src: ["**/*", ".nojekyll"]

@fang0rnz
Copy link

fang0rnz commented Mar 6, 2018

Same here, it isn't working.

@fang0rnz
Copy link

fang0rnz commented Mar 6, 2018

I'm not sure why but "-a" seems to fix the issue.

"deploy": "gh-pages -d build -a"

@siakaramalegos
Copy link

FYI, -t or --dotfiles keeps dotfiles. -a does "Only add, and never remove existing files". You can find all the options by running gh-pages --help. Glad someone else had this problem because it gave me a clue to look there.

@travi
Copy link
Author

travi commented Feb 15, 2019

for those finding this thread, it is worth being aware that -a does prevent removal of the CNAME file, but it also prevents removal of every other file as well, which is a big deal when you have to version a bunch of generated files that vary over time since github pages doesnt support a build step at deploy time.

as nice as github pages is for simple things, those two issues have motivated me to move most of my static sites to netlify instead.

RadValentin added a commit to RadValentin/valentin.io that referenced this issue May 15, 2019
Gatsby will copy any files from static/ directly to the build output folder. This is useful to preven CNAME from being removed by gh-pages, see tschaub/gh-pages#179
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants