Version control, undo and XML... oh my!

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Robster
:warning: Old Version Published before Godot 3 was released.

Quick question,

What do you all do for backup / version control?

I’ve not done it much before and really don’t understand it all that well but I’ve got to the point where I’d REALLY like an undo option and I know version control can offer this.

Also, I understand I can’t save in the default GDscript extensions, that I must use XML when using VC. Is that really correct? If so I may need to re-save all my files and link to them again with the XML format.

Any advice appreciated. Rob

:bust_in_silhouette: Reply From: heikytr

If you’re referring to “.scn” and “.res” extensions when you say “default GDscript extensions”, then yes you’ll need to change those but you don’t need to use XML, you can use “.tscn” and “.tres” since they’re text based formats they can go well with version control.

edit: I use git btw, using just a local repository can save your project sometimes. =]

Thank you, your answer makes a lot of sense. I’ll go about re-organising my project into text versions of the files so I can start using GIT. A bit to learn :slight_smile:

Robster | 2016-08-22 11:36

I highly agree with this. XML will be deprecated in 3.0, so .tscn and .tres are the only choices. They are both much cleaner than XML, as well.

This info is from this post on the Godot website.

For 3.0, this format will be the only text based format supported, and XML will be deprecated.

Also it should be noted that not all things should be .tcsn or .tres, for example imported 3D scenes should be .scn instead, because they contain a lot of vertex data that would take a long time to load with a text format, so keeping it binary is preferred. Of course the scene can be inherited and the new scene can be a .tscn since it wont contain extra vertex data.

CowThing | 2016-08-22 11:44

Great advice on all fronts. Hopefully this thread will also help others in the future.

Well, I’m happy. I can now create branches, merge them, correct conflicts. I’m away. :slight_smile:

Robster | 2016-08-22 12:55

:bust_in_silhouette: Reply From: vinod

I am using local git repository so that I can easily revert back something. Once when creating a level, I realized that I was changing an existing level, but I was way past modifying it. And Godot undo is not so well even if it is good I will lose one of my levels. But I saved the scene with a new name and a simple git checkout oldlevelname made that old level back without losing the new level.

So version control really helps.

I also don’t know much about git. I recommend you start with a local repository and you can go for remote ones as you learn.

Basic things to know are git status, git add, git commit, git checkout.

Thank you, just installed GIT and am busy learning the basics at Learn Git & GitHub | Codecademy

Now to find a nice GIT GUI for OS X.

Robster | 2016-08-22 11:36

Git comes with a built-in simple GUI, which can be invoked by typing git gui in the command line from anywhere in your repo. On Windows it even has a context menu entry in the file explorer (not sure about Mac though). Many people I know seemed to be unaware of this^^

Zylann | 2016-08-22 12:33

Thank you, I just checked it out. I have to admit that whilst it’s undoubtedly handy I quite like GitHub Desktop. It took me 10 minutes and I had it all sorted out (after doing the codecademy lessons of course).

Robster | 2016-08-22 12:59

For a local repository it might not matter much if you don’t care about a readable git history, but generally I tend to advise againt using git GUIs, and prefer to use the command line directly. Git is confusing and hard to learn, and GUIs make it even harder IMO to learn things “right” by hiding what git features it uses (fetch, pull, merge, rebase, etc.).

If you want to be able to have a readable git history, contribute to open source git repos, or work in a bigger team using git, you won’t regret learning the basics of the git command line.

Akien | 2016-08-23 12:55