unison/unison-src/transcripts/branch-command.output.md

183 lines
4.5 KiB
Markdown
Raw Permalink Normal View History

2023-04-10 19:31:15 +03:00
The `branch` command creates a new branch.
2024-06-26 03:05:50 +03:00
First, we'll create a term to include in the branches.
2023-04-10 19:31:15 +03:00
``` unison
2023-04-10 19:31:15 +03:00
someterm = 18
```
``` ucm
2024-06-26 03:05:50 +03:00
scratch/main> builtins.merge lib.builtins
2024-01-08 22:55:27 +03:00
Done.
2023-04-10 19:31:15 +03:00
2024-06-26 03:05:50 +03:00
scratch/main> add
2023-04-10 19:31:15 +03:00
⍟ I've added these definitions:
someterm : Nat
```
Now, the `branch` demo:
`branch` can create a branch from a different branch in the same project, from a different branch in a different
2024-06-26 03:05:50 +03:00
project. It can also create an empty branch.
2023-04-10 19:31:15 +03:00
``` ucm
foo/main> branch topic1
2023-04-10 19:31:15 +03:00
2023-04-18 17:08:11 +03:00
Done. I've created the topic1 branch based off of main.
2023-04-10 19:31:15 +03:00
2024-04-24 19:29:15 +03:00
Tip: To merge your work back into the main branch, first
2024-05-01 20:18:46 +03:00
`switch /main` then `merge /topic1`.
2023-04-10 19:31:15 +03:00
foo/main> branch /topic2
2023-04-18 17:08:11 +03:00
Done. I've created the topic2 branch based off of main.
2024-04-24 19:29:15 +03:00
Tip: To merge your work back into the main branch, first
2024-05-01 20:18:46 +03:00
`switch /main` then `merge /topic2`.
foo/main> branch foo/topic3
2023-04-18 17:08:11 +03:00
Done. I've created the topic3 branch based off of main.
2024-04-24 19:29:15 +03:00
Tip: To merge your work back into the main branch, first
2024-05-01 20:18:46 +03:00
`switch /main` then `merge /topic3`.
foo/main> branch main topic4
2023-04-18 17:08:11 +03:00
Done. I've created the topic4 branch based off of main.
2024-04-24 19:29:15 +03:00
Tip: To merge your work back into the main branch, first
2024-05-01 20:18:46 +03:00
`switch /main` then `merge /topic4`.
foo/main> branch main /topic5
2023-04-18 17:08:11 +03:00
Done. I've created the topic5 branch based off of main.
2024-04-24 19:29:15 +03:00
Tip: To merge your work back into the main branch, first
2024-05-01 20:18:46 +03:00
`switch /main` then `merge /topic5`.
foo/main> branch main foo/topic6
2023-04-18 17:08:11 +03:00
Done. I've created the topic6 branch based off of main.
2024-04-24 19:29:15 +03:00
Tip: To merge your work back into the main branch, first
2024-05-01 20:18:46 +03:00
`switch /main` then `merge /topic6`.
foo/main> branch /main topic7
2023-04-18 17:08:11 +03:00
Done. I've created the topic7 branch based off of main.
2024-04-24 19:29:15 +03:00
Tip: To merge your work back into the main branch, first
2024-05-01 20:18:46 +03:00
`switch /main` then `merge /topic7`.
foo/main> branch /main /topic8
2023-04-18 17:08:11 +03:00
Done. I've created the topic8 branch based off of main.
2024-04-24 19:29:15 +03:00
Tip: To merge your work back into the main branch, first
2024-05-01 20:18:46 +03:00
`switch /main` then `merge /topic8`.
foo/main> branch /main foo/topic9
2023-04-18 17:08:11 +03:00
Done. I've created the topic9 branch based off of main.
2024-04-24 19:29:15 +03:00
Tip: To merge your work back into the main branch, first
2024-05-01 20:18:46 +03:00
`switch /main` then `merge /topic9`.
foo/main> branch foo/main topic10
2023-04-18 17:08:11 +03:00
Done. I've created the topic10 branch based off of main.
2024-04-24 19:29:15 +03:00
Tip: To merge your work back into the main branch, first
2024-05-01 20:18:46 +03:00
`switch /main` then `merge /topic10`.
foo/main> branch foo/main /topic11
2023-04-18 17:08:11 +03:00
Done. I've created the topic11 branch based off of main.
2024-04-24 19:29:15 +03:00
Tip: To merge your work back into the main branch, first
2024-05-01 20:18:46 +03:00
`switch /main` then `merge /topic11`.
scratch/main> branch foo/main foo/topic12
2023-04-18 17:08:11 +03:00
Done. I've created the topic12 branch based off of main.
2024-04-24 19:29:15 +03:00
Tip: To merge your work back into the main branch, first
2024-05-01 20:18:46 +03:00
`switch /main` then `merge /topic12`.
2023-04-10 19:31:15 +03:00
foo/main> branch bar/topic
2023-04-18 17:08:11 +03:00
Done. I've created the bar/topic branch based off foo/main.
2023-04-10 19:31:15 +03:00
bar/main> branch foo/main topic2
2023-04-10 19:31:15 +03:00
2023-04-18 17:08:11 +03:00
Done. I've created the bar/topic2 branch based off foo/main.
bar/main> branch foo/main /topic3
2023-04-18 17:08:11 +03:00
Done. I've created the bar/topic3 branch based off foo/main.
scratch/main> branch foo/main bar/topic4
2023-04-18 17:08:11 +03:00
Done. I've created the bar/topic4 branch based off foo/main.
2023-04-18 18:29:34 +03:00
foo/main> branch.empty empty1
2023-04-10 19:31:15 +03:00
2023-04-18 18:29:34 +03:00
Done. I've created an empty branch foo/empty1.
2024-05-01 20:18:46 +03:00
Tip: Use `merge /somebranch` to initialize this branch.
2023-04-18 18:29:34 +03:00
foo/main> branch.empty /empty2
Done. I've created an empty branch foo/empty2.
2024-05-01 20:18:46 +03:00
Tip: Use `merge /somebranch` to initialize this branch.
2023-04-18 18:29:34 +03:00
foo/main> branch.empty foo/empty3
Done. I've created an empty branch foo/empty3.
2024-05-01 20:18:46 +03:00
Tip: Use `merge /somebranch` to initialize this branch.
2023-04-18 18:29:34 +03:00
scratch/main> branch.empty foo/empty4
2023-04-10 19:31:15 +03:00
2023-04-18 18:29:34 +03:00
Done. I've created an empty branch foo/empty4.
2023-04-10 19:31:15 +03:00
2024-05-01 20:18:46 +03:00
Tip: Use `merge /somebranch` to initialize this branch.
2023-04-10 19:31:15 +03:00
```
The `branch` command can create branches named `releases/drafts/*` (because why not).
``` ucm
foo/main> branch releases/drafts/1.2.3
Done. I've created the releases/drafts/1.2.3 branch based off
of main.
2024-04-24 19:29:15 +03:00
Tip: To merge your work back into the main branch, first
2024-05-01 20:18:46 +03:00
`switch /main` then `merge /releases/drafts/1.2.3`.
foo/main> switch /releases/drafts/1.2.3
```
The `branch` command can't create branches named `releases/*` nor `releases/drafts/*`.
``` ucm
foo/main> branch releases/1.2.3
Branch names like releases/1.2.3 are reserved for releases.
Tip: to download an existing release, try
2023-05-11 18:32:29 +03:00
`clone /releases/1.2.3`.
Tip: to draft a new release, try `release.draft 1.2.3`.
foo/main> switch /releases/1.2.3
foo/releases/1.2.3 does not exist.
```