Author Topic: How do I exit code blocks without saving?  (Read 5323 times)

Offline kccasey

  • Single posting newcomer
  • *
  • Posts: 6
How do I exit code blocks without saving?
« on: August 09, 2012, 10:50:33 pm »
I would like to Exit without saving.
It seems that code blocks saves my changes to my code as soon as I compile.  Sometimes I will screw up a program so badly that it is best to just revert back to my original.
Does anyone have a solution?

KC


Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: How do I exit code blocks without saving?
« Reply #1 on: August 09, 2012, 11:22:42 pm »
The damage has been done before you exit. Code::Blocks needs to save before compiling because the compiler works with the files outside of Code::Blocks.

The best solution is version control or frequent back ups. (I will often make backup copies of files before I tinker with them if I don't have them in version control already, but version control is the best for tinkering with working code)

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: How do I exit code blocks without saving?
« Reply #2 on: August 09, 2012, 11:38:37 pm »
If the editor is still open, you can use "Edit -> Undo" or CTRL + Z to undo changes, but it's of course better to have a working version control system if possible.

git works good with local repos and it's not too hard to setup and use (at least on linux).

Offline kccasey

  • Single posting newcomer
  • *
  • Posts: 6
Re: How do I exit code blocks without saving?
« Reply #3 on: August 09, 2012, 11:48:42 pm »
Thank you

I work with a text editor a lot so I'm spoiled.

It would be nice if  code blocks created a temp file from my original to compile, leaving my original intact .
This way I could save only when I'm confident. Just a wish.

Backups until then.

Thanks again

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9699
Re: How do I exit code blocks without saving?
« Reply #4 on: August 10, 2012, 08:21:43 am »
Backups until then.
there is an AutoSave plugin that accounts for exactly this - you can setup when and how often your files are backed up and thus restore them at any time.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline cacb

  • Lives here!
  • ****
  • Posts: 538
Re: How do I exit code blocks without saving?
« Reply #5 on: August 10, 2012, 10:04:36 am »
I would like to Exit without saving.
It seems that code blocks saves my changes to my code as soon as I compile.  Sometimes I will screw up a program so badly that it is best to just revert back to my original.
Does anyone have a solution?

KC

This is what source control is for. Personally, I prefer Bazaar, but there are other good alternatives as well. When I screw up or change my mind, I simply use the revert function in Bazaar. I think Code::Blocks does what it should do, save files often. Perhaps it should even save project files more often IMHO.