Git basics

I’ve just read through the new Git articles. Thanks @Teodor - they’re very clear and helpful. I have a couple of questions.

If I’m working on a file, I can use the branch dropdown to switch between the current branch version and the master and vice versa. However, having swiched in this way, I can’t edit the version I’ve switched to - I have to close the file and reopen it. As I can see the version I want to edit, I assumed I could then edit but I can’t. Is this as expected or am I doing something incorrectly. (I have little experience with Git.)

Also, if there is merge conflict, Wappler indicates this in a message. Is it possible to see details of the conflict or is it just a matter of comparing the files? I think George mentioned some time ago the possibility of being able to compare files, using Git’s diff feature presumably. Perhaps this will be added in the future (unless it’s already there somewhere).

We are working right now on a file compare tool for te editor so you will be able to see the exact changes.

You will be able to do that via the file manager when you click on the changed file and then sow changes.

Also when you are exploring the git history, we will add an option there to show the changes for this specific committed file.

Good point about switching branches and the current open editors. By switching branches you are actually switching to a whole new set of files, so it seems logical to me that all open files should get reloaded.

The point it what should also happen to the unsaved files? Maybe a check needs to be done before you can switch branches that unsaved changes will be lost.

In git there is also a possibility to “stash” changes so you don’t loose them. Then later you can just “unstash” them. We haven’t implemented that yet.

Maybe @patrick can also advise.

3 Likes

Thanks @George. This all sounds very exciting.

I’ve mentioned before that one of the features I miss most in Dreamweaver is being able to select a couple of files and see them displayed side by side in a diff program. It sounds like this feature will essentially be availabe in Wappler. However, where I found this feature particularly useful was being able to right-click on a file and see a comparison between local and remote versions - very helpful for debugging. I don’t know if this will be possible, but it would be great if it were. (I don’t mean comparing files in local and remote Git repositories.)

I think it would be a good idea to check for unsaved files before branch switching. I imagine it would make it easier from your point of view - eg to make the switched files editable without reloading - but also helpful as a reminder to the user anyway.

1 Like