REVIEW: Integrated Version Control with Git

As you can see in the latest Wappler 2.1.2 we have added an Wappler Native integration with the well known version control system GIT.

This will give you some great advantage in maintaining your Wappler projects by having a full control of the changes and also being able to revert and move to other point in history if something goes wrong.

If you haven’t used Git yet, please check this very good General Introduction to Git first

Wappler Version Control

With our initial implementation of version control in Wappler, you can create a Git repository for every Wappler project you wish to keep track on. Having a repository is great way to have a good backup of all your project files and their changes.

The Git Manager

The Git Manager panel is located as a second option in the left bar
image

Creating a New Local Repository

When you want to add a repository for your current project, just click on the “create Repository” button

image

Commiting files

You will immediately see a list of files from your project to commit to the repository. Initially thisse will be just all files from your project:

Just enter a nice log message about what you are committing and select the files.


In this case we are selecting all files

Now you will see that we have a new history entry with the message you entered, and no more files are to be committed:

Adding new files

Lets edit our main index.html and add something to it like the App Connect framework. After saving the file and refreshing the Git Manager, you will see that a bunch of new files have appeared and that the index.html is changed:

A - means new file is added
M - means file is modified

So lets commit this

Review history

After the commit you will see immediately that our history grows

image

Lets add some more, changes and commit them:
image

As you can see every commit is now logged with a nice message

Implementation

The repository is stored locally in your project folder under the .git sub folder

Integration with File Manager

In the file manager you can also see changed files that aren’t committed yet into the repository.
image

Reverting files

If you like to undo your file changes, to the last commit version, you can just revert the file:

This will revert the whole file to the version you have lastly committed.

More to come,

In the next updates more great Git version control functionality will be coming up. Like:

and more to come:

  • remote repositories - to connect your local repository to some cloud ones like github, bitbucket, gitlab and push and synchronize the changes there
  • file diffing between versions - to see the exact code changes.
  • and much more

So let us know what you thing of the Git version control integration and what else would you like to see.

NOTE: Git features are experimental, so you have to make sure you have the experimental setting on and restart Wappler to see them.

3 Likes

Well, this definitely looks like something I should be using on my large dashboards!

Two initial questions –

1: Does it store a complete copy of the project at each commit? In other words if I have 20 commits am I storing 20 full copies of the project?
1b: If so, won’t that take up lots of disk space?
1c: Can older commits be deleted once they are no longer of use?

2: How do you revert back to a previously committed project? Or is that still coming?

That’s all for now (I’m sure I’ll have more). I think I need to start using this!

  1. Git is really smart and stores just the differences on each new commit of set of files
  2. You can indeed go back to previous version as you wish. So it’s like an awesome backup system, like Time Machine

We current have just reverting to the last commit but more options will be coming up shortly.

Also the great thing about Git is being open standard and widely used.

So you can use the git command like if any other git tools like Gitkraken

or git-tower (from the git introduction article mentioned above):

to manage the same Wappler project repository.

But of course we will try to offer you the best git integration straight in Wappler :slight_smile:

1 Like

I just created my first ever Git Repository. Dang, that was easy - even for me. I love Wappler.

3 Likes

Everything that is implemented so far according to this short doc works wonderfully (How did I live without this feature?). I only have one issue. The File Manager Panel needs to be expanded so far to see the ‘M’ indicator. Took me a bit to realize it was there. Thought it wasn’t working at first.

Possible to move it closer, or even better, in front of the file?

this is a real PLUS of Wappler!! Great Job!!

1 Like

Works like a charm, even took notice of previous commits made in the other program.

The best part: it ook less than a minute to commit 2900 files.

3 Likes

I have an existing repo that I created and maintained through Conveyor from Wildbit. Had a couple of file to commit on my current project and did it through Wappler interface.

Then wanted to test the revert feature but it is disabled on all files I right click on. Is this because the git repo was not created through Wappler in the first place?

18

Revert is only for uncommitted files only. To get them back to the last committed state.

More advanced history backtrack and branches will be available soon

1 Like

Ok Cool! Got it, thanks

Yes, forgot to mention that we have Git natively compiled with Wappler.

So next to the awesome speed it also has the advantage that no external git program is required any more.

Everything is included in Wappler!

3 Likes

Will it be possible to upload specific files from previous versions/commits? Rarely would I want to re-upload a complete site.

Will there be a way to add exclusions? Currently, could we add exclusions in .git/info/exclude or .gitignore (or neither)?

The file diffing feature you mentioned sounds very useful. I don’t know if it will be possible, but what I would find very useful would be a way to compare local and remote versions of a particular file (ie current versions).

I’m wondering how new versions of Wappler .js files etc. will be handled after an update. Will we see ‘M’ and ‘A’ next to the relevant files? That would be useful.

I’m looking forward to see how this all develops. Git is a great addition to Wappler.

1 Like

Brilliant, gone are my daily backups and dragging files back onto the live section from those folders and all so easy!

2 Likes

Yes - only changed files will be uploaded. You will get a nice synchronization overview of the difference and choose what do you want to do.

Yes Git works with a simple list in file called .gitignore. We will be adding global settings for that just as we now also have settings for ftp to exclude files in the Global Wappler FTP settings

Yes we will offer a special code diffing view in Wappler so you can clearly see the difference. Might even make a visual diffing tool so you can visually see the difference between two html pages. Like two design views next to each other where the differences are highlighted.

Diffing is important when you want to switch to different versions - or just to inspect what has changed.

Yes Wappler’s extensions assets files, will just show as any other updated files. So you can commit them nicely together in your Wappler project git repository.

We will be making also more improvements there in the future as global Wappler Extensions assets updater and keeping also note of which extensions version were used in which project, so those stay with your version control in sync.

2 Likes

Thanks George - that all sounds excellent.

I used the file comparison feature in Dreamweaver a lot - or, rather, from within DW. DW doesn’t actually have its own diff tool, but you just had to enter the path to your chosen diff software in Preferences, and the selected files (eg local and remote version) would open up in that application, side by side. I suppose many of these tools must work in similar ways. It would great if such a feature were built into Wappler, but this might be a simpler/additional option.

1 Like

Am I being dumb… I cant seem to see the Git icon (running the latest version of Wappler currently)

Hello @datguru,
As explained these are still experimental features, so you need to enable experimental features in Wappler settings, then restart Wappler:

1 Like

Thanks Teodor… sorry I couldnt see anything in the post that said experimental needed to be enabled… working perfectly now though

QoL improvement: Add next to the commit button an additional self-explanatory button called “Commit and Push”.

hey! it’d be great if we did not have to enter the user and pass on GIT every time we reopen Wappler!
can we have ‘save password’ or just save it bu default?

2 Likes