2023-04-06 17:01:50 +03:00
|
|
|
Deleting the branch you are on takes you to its parent (though this is impossible to see in a transcript, since we set
|
|
|
|
your working directory with each command).
|
|
|
|
|
2024-07-10 19:17:15 +03:00
|
|
|
``` ucm
|
2023-05-01 21:15:48 +03:00
|
|
|
foo/main> branch topic
|
2023-04-06 17:01:50 +03:00
|
|
|
|
2023-04-18 17:08:11 +03:00
|
|
|
Done. I've created the topic branch based off of main.
|
2023-04-10 19:49:09 +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 /topic`.
|
2023-04-06 17:01:50 +03:00
|
|
|
|
|
|
|
foo/topic> delete.branch /topic
|
|
|
|
|
2023-05-01 21:15:48 +03:00
|
|
|
```
|
|
|
|
A branch need not be preceded by a forward slash.
|
|
|
|
|
2024-07-10 19:17:15 +03:00
|
|
|
``` ucm
|
2023-05-01 21:15:48 +03:00
|
|
|
foo/main> branch topic
|
|
|
|
|
|
|
|
Done. I've created the topic 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 /topic`.
|
2023-05-01 21:15:48 +03:00
|
|
|
|
|
|
|
foo/topic> delete.branch topic
|
|
|
|
|
|
|
|
```
|
|
|
|
You can precede the branch name by a project name.
|
|
|
|
|
2024-07-10 19:17:15 +03:00
|
|
|
``` ucm
|
2023-05-01 21:15:48 +03:00
|
|
|
foo/main> branch topic
|
|
|
|
|
|
|
|
Done. I've created the topic 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 /topic`.
|
2023-05-01 21:15:48 +03:00
|
|
|
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> delete.branch foo/topic
|
2023-05-01 21:15:48 +03:00
|
|
|
|
2023-04-06 17:01:50 +03:00
|
|
|
```
|
|
|
|
You can delete the only branch in a project.
|
|
|
|
|
2024-07-10 19:17:15 +03:00
|
|
|
``` ucm
|
2023-04-06 17:01:50 +03:00
|
|
|
foo/main> delete.branch /main
|
|
|
|
|
|
|
|
```
|
2024-07-03 20:20:20 +03:00
|
|
|
You can delete the last branch in the project, a new one will be created.
|
|
|
|
|
2024-07-11 06:49:04 +03:00
|
|
|
``` ucm
|
2024-07-03 20:20:20 +03:00
|
|
|
scratch/main> delete.branch scratch/main
|
|
|
|
|
|
|
|
scratch/main> branches
|
|
|
|
|
|
|
|
Branch Remote branch
|
|
|
|
1. main
|
|
|
|
2. main2
|
|
|
|
|
|
|
|
```
|
|
|
|
If the the last branch isn't /main, then /main will be created.
|
|
|
|
|
2024-07-11 06:49:04 +03:00
|
|
|
``` ucm
|
2024-07-03 20:20:20 +03:00
|
|
|
scratch/main2> delete.branch /main
|
|
|
|
|
|
|
|
scratch/main2> delete.branch /main2
|
|
|
|
|
|
|
|
scratch/other> branches
|
|
|
|
|
|
|
|
Branch Remote branch
|
|
|
|
1. main
|
|
|
|
2. other
|
|
|
|
|
|
|
|
```
|