Save your Flexlate Updates¶
Flexlate saves the history of your merge conflict resolutions so that you don’t need to resolve them multiple times. Flexlate mostly manages this history for you, but you do get to choose when you want to “save” the history by merging the Flexlate feature branches into the Flexlate main branches.
After doing a Flexlate operation such as
fxt update,
fxt add output, or
fxt sync Flexlate will create feature branches
to correspond to your currently checked out branch. In order to save the
Flexlate history, you need to merge these Flexlate feature branches into
the Flexlate main branches.
Local Workflows¶
If directly commit to the main branch or locally merge branches into
your main branch, you will want to use the
fxt merge command locally to save your history.
You can then push the changes to remote with
fxt push main
Committing on the Main Branch¶
If you commit on the main branch, let’s call it main, you will have
Flexlate feature branches created corresponding to your main branch.
Simply call fxt merge whenever you finish a Flexlate operation
and are satisfied with the result.
$ fxt add output copier-simple-example some/path
Applying template copier-simple-example to /tmp/tmplmyk7tpm
Updating 1 applied templates
question1? Format: yaml
my answer
The second question
question2? Format: float
10
create my answer.txt
create temp.txt
✔ Successfully updated template output
✔ Successfully applied template copier-simple-example to /tmp/tmplmyk7tpm
$ fxt merge
Merging flexlate-templates-main to flexlate-templates
✔ Successfully merged flexlate-templates-main to flexlate-templates
✔ Successfully merged flexlate-output-main to flexlate-output
Deleting flexlate feature branches flexlate-templates-main and
flexlate-output-main
✔ Successfully deleted flexlate feature branches
Locally Merging Branches¶
After you’ve done a template update on a feature branch and you’re ready
to merge the changes into main, first run fxt merge before doing so.
$ git checkout -b feature-branch
Switched to a new branch 'feature-branch'
$ fxt add output copier-simple-example some/path
Applying template copier-simple-example to /tmp/tmph9tlmh1g
Updating 1 applied templates
question1? Format: yaml
my answer
The second question
question2? Format: float
10
create my answer.txt
create temp.txt
✔ Successfully updated template output
✔ Successfully applied template copier-simple-example to /tmp/tmph9tlmh1g
$ fxt merge
Merging flexlate-templates-feature-branch to flexlate-templates
✔ Successfully merged flexlate-templates-feature-branch to flexlate-templates
✔ Successfully merged flexlate-output-feature-branch to flexlate-output
Deleting flexlate feature branches flexlate-templates-feature-branch and
flexlate-output-feature-branch
✔ Successfully deleted flexlate feature branches
$ git checkout main
Switched to branch 'main'
$ git merge feature-branch
Updating 10fec1a..4d67875
Fast-forward
some/path/flexlate.json | 15 +++++++++++++++
some/path/my answer.txt | 2 ++
2 files changed, 17 insertions(+)
create mode 100644 some/path/flexlate.json
create mode 100644 some/path/my answer.txt
Push your Flexlate Main Branch Changes¶
After you’ve merged the Flexlate feature branches into the Flexlate main
branches, you’ll want to push your changes to the remote (if you are using
a remote) via fxt push main.
$ fxt add output copier-simple-example some/path
Applying template copier-simple-example to /tmp/tmpbei3ragb
Updating 1 applied templates
question1? Format: yaml
my answer
The second question
question2? Format: float
10
create my answer.txt
create temp.txt
✔ Successfully updated template output
✔ Successfully applied template copier-simple-example to /tmp/tmpbei3ragb
$ fxt merge
Merging flexlate-templates-main to flexlate-templates
✔ Successfully merged flexlate-templates-main to flexlate-templates
✔ Successfully merged flexlate-output-main to flexlate-output
Deleting flexlate feature branches flexlate-templates-main and
flexlate-output-main
✔ Successfully deleted flexlate feature branches
$ fxt push main
Pushing flexlate-templates and flexlate-output to remote origin
✔ Successfully pushed branches to remote
PR Workflows¶
If you use pull requests in your project to merge changes into the main branch,
then instead of merging locally, you will want to push the Flexlate
feature branches with fxt push feature
so that they can be merged in on the remote.
Push your Flexlate Feature Branch Changes¶
Use the fxt push feature command to push
the Flexlate feature branches after you’ve finished work on your feature branch.
You would want to run this whenever you are pushing up the feature branch itself.
$ git checkout -b feature-branch
Switched to a new branch 'feature-branch'
$ fxt add output copier-simple-example some/path
Applying template copier-simple-example to /tmp/tmppky52zhz
Updating 1 applied templates
question1? Format: yaml
my answer
The second question
question2? Format: float
10
create my answer.txt
create temp.txt
✔ Successfully updated template output
✔ Successfully applied template copier-simple-example to /tmp/tmppky52zhz
$ git push origin feature-branch
Enumerating objects: 22, done.
Counting objects: 4% (1/22)
Counting objects: 9% (2/22)
Counting objects: 13% (3/22)
Counting objects: 18% (4/22)
Counting objects: 22% (5/22)
Counting objects: 27% (6/22)
Counting objects: 31% (7/22)
Counting objects: 36% (8/22)
Counting objects: 40% (9/22)
Counting objects: 45% (10/22)
Counting objects: 50% (11/22)
Counting objects: 54% (12/22)
Counting objects: 59% (13/22)
Counting objects: 63% (14/22)
Counting objects: 68% (15/22)
Counting objects: 72% (16/22)
Counting objects: 77% (17/22)
Counting objects: 81% (18/22)
Counting objects: 86% (19/22)
Counting objects: 90% (20/22)
Counting objects: 95% (21/22)
Counting objects: 100% (22/22)
Counting objects: 100% (22/22), done.
Delta compression using up to 2 threads
Compressing objects: 6% (1/16)
Compressing objects: 12% (2/16)
Compressing objects: 18% (3/16)
Compressing objects: 25% (4/16)
Compressing objects: 31% (5/16)
Compressing objects: 37% (6/16)
Compressing objects: 43% (7/16)
Compressing objects: 50% (8/16)
Compressing objects: 56% (9/16)
Compressing objects: 62% (10/16)
Compressing objects: 68% (11/16)
Compressing objects: 75% (12/16)
Compressing objects: 81% (13/16)
Compressing objects: 87% (14/16)
Compressing objects: 93% (15/16)
Compressing objects: 100% (16/16)
Compressing objects: 100% (16/16), done.
Writing objects: 4% (1/22)
Writing objects: 9% (2/22)
Writing objects: 13% (3/22)
Writing objects: 18% (4/22)
Writing objects: 22% (5/22)
Writing objects: 27% (6/22)
Writing objects: 31% (7/22)
Writing objects: 36% (8/22)
Writing objects: 40% (9/22)
Writing objects: 45% (10/22)
Writing objects: 50% (11/22)
Writing objects: 54% (12/22)
Writing objects: 59% (13/22)
Writing objects: 63% (14/22)
Writing objects: 68% (15/22)
Writing objects: 72% (16/22)
Writing objects: 77% (17/22)
Writing objects: 81% (18/22)
Writing objects: 86% (19/22)
Writing objects: 90% (20/22)
Writing objects: 95% (21/22)
Writing objects: 100% (22/22)
Writing objects: 100% (22/22), 2.60 KiB | 887.00 KiB/s, done.
Total 22 (delta 6), reused 0 (delta 0), pack-reused 0
To ../remote
* [new branch] feature-branch -> feature-branch
$ fxt push feature
Pushing flexlate-templates-feature-branch and flexlate-output-feature-branch to
remote origin
✔ Successfully pushed branches to remote
Merge Flexlate Branches Automatically with Github Actions¶
Flexlate has official companion Github Actions that can automate using Flexlate. The Flexlate After-Merge Action can be used to automate merging the Flexlate feature branches into the Flexlate main branches.
Follow the user guide on CI automation to hook up this workflow and other supporting workflows.