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

Deleting history of past commits with GitHub pages

Open muradkhateeb78 opened this issue 2 years ago • 3 comments

  • Context

    I have a react app which I have deployed to GitHub Pages, its actually the documentation of my project. I have a different repository which has the source code of my main project and whenever a change is made in my main branch, it triggers the documentation build which updates the "gh-pages" and ultimately the project documentation.

  • Problem Statement

    We work in a team and push frequent changes to main branch and it triggers the documentation action every time. Which is good but it also maintains all the history of the commits which makes the documentation app branch heavier and difficult to maintain. We do not want to keep all the commits, just the latest one should suffice. While pushing to the "gh-pages" we want to delete all the commits except the latest one.

  • Our Analysis We could run git commands to get rid of the existing commits but we want to know how we can customize "npm run deploy" command to do this or if there exists any other configuration/operational parameters that we can use to achieve this?

muradkhateeb78 avatar Sep 12 '23 10:09 muradkhateeb78

Any comments, anybody?

muradkhateeb78 avatar Sep 13 '23 07:09 muradkhateeb78

Hi @muradkhateeb78, thanks for describing your situation in such an organized way and with so much detail.

or if there exists any other configuration/operational parameters that we can use to achieve this?

The gh-pages part of the deploy script defined in package.json is referring to a CLI utility provided as part of the gh-pages NPM package.

You can run the gh-pages command manually (i.e. not via npm run) and append the --help option to see the configuration options available. Then, assuming you find one that does what you want, you can edit the deploy script in package.json accordingly.

Docs: https://github.com/tschaub/gh-pages#command-line-utility

gitname avatar Nov 06 '23 01:11 gitname

Hi @muradkhateeb78, did that answer your question? Are you still having issues?

gitname avatar Dec 28 '23 20:12 gitname

No reply in 5 months. Closing.

gitname avatar Apr 28 '24 05:04 gitname