Skip to content

Commit ed1e855

Browse files
committed
add fearless rebasing and rename trunk/base to target
1 parent 49c277c commit ed1e855

15 files changed

+83
-75
lines changed

content/docs/features/virtual-branches/branch-lanes.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import ImageSection from "@/components/ImageSection"
66

77
How do you manage your virtual branches?
88

9-
The main interface for Virtual Branches are a series of branch lanes. Each lane represents a scope of work that is different than what your current base branch (ie, `origin/master`) looks like. Work that is not yet in production.
9+
The main interface for Virtual Branches are a series of branch lanes. Each lane represents a scope of work that is different than what your current target branch (ie, `origin/master`) looks like. Work that is not yet in production.
1010

1111
This could be a local virtual branch that you're working on, or it could be a virtual branch that was created from a remote branch.
1212

@@ -27,17 +27,17 @@ An example of working on two branches at the same time, while pending upstream c
2727

2828
The sidebar on the left shows you the stashed virtual branches that you have and the "other" branches that you have available (legacy git branches, remote branches and PRs). All of these branches can be converted into virtual branches by clicking them and then clicking the "Apply" button on the branch view.
2929

30-
### Trunk
30+
### Target
3131

32-
The "Trunk" is the view of the base branch that you've set. It will show you essentially a `git log` of `origin/master` or whatever you set as your base branch, and it will show you if there are any commits upstream that you have not integrated locally yet. We will automatically check for new upstream changes every few minutes, but you can also click the update button to check immediately.
32+
The "Target" is the view of the target branch that you've set. It will show you essentially a `git log` of `origin/master` or whatever you set as your target branch, and it will show you if there are any commits upstream that you have not integrated locally yet. We will automatically check for new upstream changes every few minutes, but you can also click the update button to check immediately.
3333

3434
<ImageSection
3535
width={700}
3636
height={600}
3737
className="mx-auto"
3838
alt="Virtual Branches Example"
39-
src="/img/docs/branch-lanes-02.webp"
40-
subtitle="A screenshot showcasing the Trunk view."
39+
src="/img/docs/merge-upstream.png"
40+
subtitle="A screenshot showcasing the Target view."
4141
/>
4242

4343
### Workspace
@@ -72,7 +72,7 @@ You can inspect any file change by clicking on the file path. GitButler will exp
7272
subtitle="Inspecting our file change"
7373
/>
7474

75-
Once you have committed work, you will see it at the bottom as a list of commits under a tag that indicates that they are local. If you hit the "Push" button, it will attempt to push these commits to the same remote server that your base branch is on.
75+
Once you have committed work, you will see it at the bottom as a list of commits under a tag that indicates that they are local. If you hit the "Push" button, it will attempt to push these commits to the same remote server that your target branch is on.
7676

7777
If you have authenticated to GitHub, you also have the option to create a Pull Request for that branch automatically.
7878

content/docs/features/virtual-branches/butler-flow.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,22 @@ However, a decade later, and with a new and more powerful branching toolset, we'
1313
## Overview
1414

1515
- In a nutshell, the basic development cycle is very simple.
16-
- All work is based off a "base branch", which is a representation of released production code.
16+
- All work is based off a "target branch", which is a representation of released production code.
1717
- All work immediately exists in a branch.
1818
- Work can be shared with teammates for review as early as possible.
1919
- All branches that are close to merging can be applied locally for integration testing.
2020
- Branches can be reviewed independently and merged after final review.
2121
- Integrated branches are automatically removed from developer context.
2222

23-
### The Base Branch
23+
### The Target Branch
2424

2525
In stock Git tooling, there is nothing specified as the production branch, no special "trunk". It is only by convention that this is enforced.
2626

27-
In GitButler, virtual branches will not work without the specification of a special "base branch". Everything exists in relation to this special branch, everything that differs from it must be accounted for by being owned by some other branch, until those changes are integrated.
27+
In GitButler, virtual branches will not work without the specification of a special "target branch". Everything exists in relation to this special branch, everything that differs from it must be accounted for by being owned by some other branch, until those changes are integrated.
2828

2929
### Virtual Branches
3030

31-
Once you choose a base branch, everything that is in your working directory and not ignored by the Git ignore specification must be owned by a virtual branch. If you don't have one active, GitButler will automatically create one for you.
31+
Once you choose a target branch, everything that is in your working directory and not ignored by the Git ignore specification must be owned by a virtual branch. If you don't have one active, GitButler will automatically create one for you.
3232

3333
All subsequent changes to your working directory, either by applying other branches or directly modifying files, must be owned by a virtual branch.
3434

@@ -46,4 +46,4 @@ Merge conflicts are known almost as soon as they occur and can be communicated a
4646

4747
### Maintenance
4848

49-
Virtual branches can remain applied locally until they are merged into your upstream base branch. Once integrated by any fashion (squash merge, rebase, merge), the virtual branch is automatically disposed of, keeping cruft and overhead low.
49+
Virtual branches can remain applied locally until they are merged into your upstream target branch. Once integrated by any fashion (squash merge, rebase, merge), the virtual branch is automatically disposed of, keeping cruft and overhead low.

content/docs/features/virtual-branches/commits.mdx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,3 +134,22 @@ You can also arbitrarily change the order of your commits by dragging and droppi
134134
alt="Moving Commits"
135135
src="/img/docs/commits-09.gif"
136136
/>
137+
138+
## Edit Mode
139+
140+
The other way that you can modify a commit is to go into "Edit Mode". When you click on a commit, there is a button that says "Edit patch". If you click this, GitButler will check out that commit by itself into your working directory (automatically stashing everything else temporarily).
141+
142+
The screen will go into "Edit mode", indicating that you're in a special state where you're focusing on this one commit.
143+
144+
<ImageSection
145+
subtitle="Editing a commit"
146+
width={700}
147+
height={600}
148+
className="mx-auto"
149+
alt="Editing a commit"
150+
src="/img/docs/conflicts-edit-mode.png"
151+
/>
152+
153+
Then you can change whatever you want and when you click "Save and exit", it will amend the commit you were editing and rebase anything on top of it.
154+
155+
This is useful for things like getting feedback on a series and being able to go into the appropriate commit, make the changes and continue, as opposed to squashing work.
Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,46 @@
11
---
2-
title: Merging
2+
title: Rebasing and Conflicts
33
---
44

55
import ImageSection from "@/components/ImageSection"
66

7-
Conflicts happen sometimes, what to do when we get there?
7+
By default, GitButler rebases the work on your virtual branches when you update your target branch (upstream) work.
88

9-
So, let's talk a little bit more about merging. Merging in GitButler is a little different than in Git because by default, all applied virtual branches are actually merged in your working directory, as though you had run a `git merge` or `git pull` command.
9+
Often this works just fine and the commits are simply rebased. Occasionally, you will have conflicts with upstream work.
1010

11-
However, it doesn't need to actually make the merge commit and tie those contexts together forever. It can simply do the merge, give you the result and keep track of what you do to it. This allows you to unmerge and remerge at will, as long as the branches merge cleanly.
11+
In this case, GitButler will not do what Git normally does, which is to stop at each conflicted commit and make you fix it before moving on. Instead, it will apply the changes that it can and store the commit as a "conflicted" commit and continue the rebasing process.
1212

13-
The other interesting thing is that you cannot get two branches into a conflicting state while they are both applied, because all code in your working directory has to be owned by something. If you come across a part that overlaps, you have to choose which branch owns it or else unapply one of them.
14-
15-
## Merge Conflicts
16-
17-
You also cannot (currently) apply two virtual branches that conflict with each other. That means that the only way to merge two branches that have conflicts is to land one upstream in your base branch first, then integrate that so that it's your base and then pull those conflicting changes into your working directory and solve them.
18-
19-
In other words, branches can only conflict with upstream changes and you can only resolve one upstream conflicted branch at a time. This is something we will work on changing, but it is a limitation currently.
20-
21-
When you do have an upstream conflicting branch, you can choose to apply it, which will unapply all other branches and apply this one with conflict markers into your files. Your only branch lane will look something like this:
13+
When you go to update from upstream, GitButler will show you all the branches that it will rebase and will let you know if any of them will have conflicts:
2214

2315
<ImageSection
16+
subtitle="One branch has a conflict with the upstream work"
2417
width={700}
2518
height={600}
2619
className="mx-auto"
27-
alt="Viewing Remote Branches"
28-
src="/img/docs/merging-01.avif"
29-
subtitle="A virtual branch in a conflicted state."
20+
src="/img/docs/conflicts-incoming.png"
21+
alt="Conflicts with commits"
3022
/>
3123

32-
While the branch is in this state, you cannot apply other branches or unapply this one. (We are working on a way to abort this state, but right now you cannot).
24+
In this case, when you perform the rebase, that branch will then contain "conflicted" commits. They will be marked in the UI as conflicted and you can click on them to get a "resolve conflict" button to start the resolution process.
3325

34-
You need to resolve each issue, then hit the "Resolve" button next to each file once they are resolved. This is similar to running `git add` on resolved files in a conflicted merge state in stock Git.
26+
<ImageSection
27+
subtitle="Resolving a conflict"
28+
width={700}
29+
height={600}
30+
className="mx-auto"
31+
src="/img/docs/conflicts-conflicted.png"
32+
alt="Conflicts with commits"
33+
/>
3534

36-
Once all the files are marked as resolved, you need to commit the resolved merge. This will write a merge commit with both parents so that you have an updated merge base.
35+
When you click that, GitButler will remove the other virtual branches and other work from your working directory and check out just this commit with it's conflict markers. It will show you a special "edit mode" screen, where you are directly editing this commit.
3736

3837
<ImageSection
38+
subtitle="Resolving a conflict"
3939
width={700}
4040
height={600}
4141
className="mx-auto"
42-
alt="Viewing Remote Branches"
43-
src="/img/docs/merging-02.avif"
44-
subtitle="Now you need to commit your resolution."
42+
src="/img/docs/conflicts-edit.png"
43+
alt="Conflicts with commits"
4544
/>
4645

47-
Once the resolution is committed, you can unapply and apply branches again.
46+
If you want to cancel this conflict resolution, you can just hit 'Cancel' and it will go back to your normal state. If you have fixed all the issues, you can click "Save and Exit" and it will commit the conflict resolution and if needed, rebase any further commits on that branch on top of your new work.

0 commit comments

Comments
 (0)