Hate to complain... but I wonder if I'm alone in that

I absolutely hate the new versioning system

…? What new versioning system?

I’m probably the last to move to the new editor, and admittedly have only begun to read about the new versioning (Git-like), publishing, etc.

@dconnell yeah, if git is not something you are familiar with the learning curve can be a bit steep. I still feel like a git newbie and I’ve been at it for years now.

I was just really thankful for it just a second ago. Maybe it would be helpful for a little show and tell.

Background

I use Leaflet for mapping on a production app. I keep things simple and in most cases only have two brances:

master: The published version and also the version that I point to for dependency apps.
develop: Where I do normal development and testing.

I always work in develop and I only merge into master. This just keeps things simple.

I have been working on a major update to my mapping app on the development branch when I found an error in production. This was a strange z-index issue where the map was hovering above the navigation bar on mobile.

So, my situation:

  • I have a bunch of work on the development branch that is not finished and not ready for production.
  • I need to fix this z-index issue for production
  • I don’t trust my CSS skills to just make this change to production without breaking something

image

Here is the power of git:

  1. I created a new branch fix_z_index (the red? orange? above) from the master branch (blue)
    This is a copy of the published version without all of the changes I’ve been working on in the develop branch (yellow).
    Notice how that red line branches off the lowest blue dot.
  2. I can now work on this fix in this branch without impacting anything else
  3. I have apps that depend on this. In these apps in their development branch, I can set the dependency to the fix_z_index branch and test the changes.
  4. Once I’m happy with the changes, everything is tested and looks good, I can then merge these changes into the master branch. Red/Orange line into the top blue dot.
  5. Now, my master branch is ahead of my develop branch… No problem, I just merge master into develop so develop now has the z-index fix. This is the blue line into the top yellow dot.

Start Simple

Git is hard. But, you can start simple! I would recommend using just the master branch at first with the published app pointing to a specific commit rather than the branch.

image

In the Version History tab you can right click a commit and select “Publish this commit”. Now, you can happily make your changes and test them from the IDE with Run. Once you are happy with the current state, Publish the newest commit.

It is when you get into a situation like the one above where making a new branch will be helpful. If I only used a single branch, I would not have been able to make that small z-index fix alone since I had a bunch of feature commits in there as well.

But, when that situation arises, you can make your first branch off the published commit, make your changes then point Published to the commit on the new branch. Eventually when your master branch is at a state you like again, you will move the Published version back over.

4 Likes

OK, I love the new editor’s Versioning system

3 Likes