about

docs

pricing

oss

consulting

Appearance

Advanced Commands


Page:
/product
Last Section:


Overview

You don't need to know the ins and outs of floro to make good use of it. However, there are times when you may get into a pickle and some advanced floro commands may come in handy. Problems like, how do we undo a commit?, are pretty core to floro and version control in general.


Stashing & discarding

When you are in edit mode you will notice there is an option to stash or discard your changes.




Discarding means you are  deleting your work in progress (WIP) permanently. Discarding restores your state to the state of the last commit. If you are positive you do not want to commit your changes or you've made a huge mistake, this is a useful option.

Stashing is like a temporary discard. Instead of deleting your work in progress, you store it in a stash (each commit has its own stash). If you want to restore your stash, you may be able to restore if your new changes do not conflict with your stashed changes. If your new changes do conflict with your stashed changes, you may have to discard your new work in progress.




When you have stashed changes that are able to be applied to your current changes, you will see the pop stash button is available to you. After, clicking, you should see your restored changes.



Clearing plugin client storage

Plugins, like websites, have the ability to store information in something similar to website cookies. A plugin's client storage might be used to save an API key or some preferred setting of the user that should not be persisted in the plugin state store. You may notice there is a "clear plugin storage" option available when a plugin is storing some information using client storage. Plugins cannot access each other's client storage.






Undoing commits

There are three ways to undo a commits in floro. Generally speaking, you will revert a commit or fix forward a commit if you are undoing a commit remotely or on a shared branch. However, if you are the only person working on a branch it may be more desirable to change the head of your branch to a past commit. This is considered a history destructive interaction though, so this should only be done on branches that you are working on independently of other collaborators. 

Undo method 1. Changing the branch head
  
To change a branch's head, you need to click the edit branch button locally. From there you will see a button called perform surgery. Manually editing branches can get a little bit messy. Make sure your base branch is correct after editing a branch head. 




Now all you have to do is hover over the commit you wish to update your branch to and select that commit by pressing change head. Your previous commit will not be deleted, so if you need, you can always reset your branch head back to the original commit. After clicking edit branch, your branch will be updated.

Undo method 2. Reverting a commit

Sometimes we want to undo a commit, but other people may be working on the same branch as us. Changing a branch head can lead to conflicts amongst collaborators and collaborators stepping on each other's toes. In the case of shared branches, we may want to revert our changes. Reverting has the same end effect as manually rolling back a branch's head, however, reverting creates a new commit that undoes the changes between the last commit and the commit being reverted. This is useful when a branch is shared by multiple contributors since the reversion does not alter the version history (it just adds to it), but resets the state of the branch to the commit before the reverted commit.




Undo method 3. Fixing forward

Fix forward is similar to reverting but with one giant difference -- rather than undoing all changes after a commit, fix forward removes only the commit that is selected, not the entire history succeeding it. This makes fix forward a great option if there is a change you want to remove but additional work you want to keep has been performed on the branch already. Under the hood, fix forward performs a merge operation, which means it won't always be available if the forward merge has conflicts. Like reverting, fixing forward is non-destructive to version history. This means it's entirely safe to use for shared branches.

Deleting commits

There is no such thing as deleting a commit in floro. If you could, floro wouldn't work at all. The three methods mentioned above cover all the ways you can undo a commit. For this reason, you should be particularly careful about entering sensitive information into floro.


Cherry picking

Cherry picking is the process of taking a commit and applying its changes to your current state. You can cherry pick any commit, it does not have to be in your current branch. A cherry pick looks at what changes the commit made from the commit directly before it and attempts to apply those same changes to the current state of your repository. Cherry-picking does not result in a new commit being created, it just alters your work in progress (WIP).




Cherry picking also uses a merge operation to calculate the cherry-picked state. Therefore, it may not be available if the cherry pick results in a conflicted state.


Amending commits

You should not amend, but you can 🙃. Sometimes you make a mistake or a typo in a commit message. Some people care about these sorts of things (others do not). Since you cannot delete a commit from floro, you need to amend your commit when you want to alter the commit message. When you amend, you create a new commit that contains all the changes of your commit but with a new commit message. Amending is risky because it is destructive to version history and can result in redundant conflicts for anyone working together collaboratively. You should only amend commits on branches you are working on in isolation or on commits that you have not pushed to your remote repository yet.



Checking out commits

Sometimes you might want to checkout a commit without updating your branch. This is useful when you're looking at previous commits or you're considering editing a branch's head. When you checkout a commit, you will be branch-less. When you are working without a branch, you can still merge, commit, cherry pick, etc. You cannot push commits to floro when you are in a branchless state.



Next section

We're now ready to cover how floro interacts with your website and its content.

In the next section we will be covering using the floro chrome extension.