sintaxi / surge

CLI for the surge.sh CDN
https://surge.sh
2.84k stars 135 forks source link

How can i recover my old website? #440

Closed HenriqueRamos13 closed 3 years ago

HenriqueRamos13 commented 3 years ago

I own a domain that doesn't arise where I accidentally pushed and overwrote an old project that was not saved in git (I don't know why I didn't use git). Does surge have any kind of commits to recover old files?

fu-sen commented 3 years ago

I'm currently trying the development version triggered by another issue, and the help is:

PS C:\Users\balloon> surge --help

  Main Usage:
    surge <project-path> <domain>       publish project to domain

  Project Commands:
    surge cutover <preview>             change to latest revision
    surge discard <preview>             remove revision from system
    surge rollfore <domain>             change to next revision
    surge rollback <domain>             change to previous revision
    surge teardown <domain>             tear down a published project
    surge invite <domain> <emails>      invites user to be a contributor
    surge revoke <domain> <emails>      revokes contributor rights
    surge list <domain>                 list all revisions
    surge ssl <domain> <pempath>        publish .pem file for SSL support

@sintaxi Have you already implemented rollback? Will it be implemented now?

HenriqueRamos13 commented 3 years ago

My surge --help show me this:

hr@Ft lead % surge --help                                  

  surge – single command web publishing. (v0.21.7)

  Usage:
    surge <project> <domain>

  Options:
    -a, --add           adds user to list of collaborators (email address)
    -r, --remove        removes user from list of collaborators (email address)
    -V, --version       show the version number
    -h, --help          show this help message

  Additional commands:
    surge whoami        show who you are logged in as
    surge logout        expire local token
    surge login         only performs authentication step
    surge list          list all domains you have access to
    surge teardown      tear down a published project
    surge plan          set account plan

  Guides:
    Getting started     surge.sh/help/getting-started-with-surge
    Custom domains      surge.sh/help/adding-a-custom-domain
    Additional help     surge.sh/help

  When in doubt, run surge from within your project directory.

and rollback:

  hr@Ft lead % surge rollback https://www.domain.com.br

  Running as hramos13@gmail.com (Student)

   Aborted - No such file or directory: rollback
fu-sen commented 3 years ago

Yes. You still have too fast an action. Please wait for comments from the developers.

sintaxi commented 3 years ago

@HenriqueRamos13 yes! surge has this in the upcoming release which you can install and test out.

  1. Install the preview release of surge by running npm install -g surge@edge. This will install version 0.23.0-rc.3 which you can check by running surge --version.
  2. Run surge list www.domain.com.br to see all previous versions of your site.
  3. Run surge rollback www.domain.com.br to rollback to the version you want. Changes are instant.
  4. Running surge rollfore www.domain.com.br will do the opposite.
  5. Running surge discard 123456789.www.domain.com.brwill discard the release 123456789.

Let me know if you need further assistance.

HenriqueRamos13 commented 3 years ago

@sintaxi It worked! But is it possible for me to get the files from this site? Like a git clone, because the site is back to normal but the files are still the most recent

fu-sen commented 3 years ago

Unfortunately it is not a feature of Surge. But you can: https://www.google.com/search?q=site+downloader

From here on, it's not what Surge supports, so you're good enough to close it.

HenriqueRamos13 commented 3 years ago

Ty!