Fossil SCM
Clarified and expanded the "create branches at point of need" section of the gitusers.md doc.
Commit
331dc0d334f6566d917052c473a0be523bf9e0d73e8db8d0fe8e7c4e2df0540a
Parent
b0ee3d5d75b38ff…
1 file changed
+32
-10
+32
-10
| --- www/gitusers.md | ||
| +++ www/gitusers.md | ||
| @@ -65,24 +65,46 @@ | ||
| 65 | 65 | If you only want to commit just some of the changes, you can list the names |
| 66 | 66 | of the files you want to commit as arguments, like this: |
| 67 | 67 | |
| 68 | 68 | fossil commit src/main.c doc/readme.md |
| 69 | 69 | |
| 70 | -## Create Branches After-The-Fact | |
| 71 | - | |
| 72 | -Fossil perfers that you create new branches when you commit using | |
| 73 | -the "`--branch` _BRANCH-NAME_" command-line option. For example: | |
| 74 | - | |
| 75 | - fossil commit --branch my-new-branch | |
| 76 | - | |
| 77 | -It is not necessary to create branches ahead of time, as in Git, though | |
| 78 | -that is allowed using the "`fossil branch new`" command, if you | |
| 79 | -prefer. Fossil also allows you to move a check-in to a different branch | |
| 70 | +## Create Branches At Point Of Need, Rather Than Ahead of Need | |
| 71 | + | |
| 72 | +Fossil prefers that you create new branches as part of the first commit | |
| 73 | +on that branch: | |
| 74 | + | |
| 75 | + fossil commit --branch my-new-branch | |
| 76 | + | |
| 77 | +If that commit is successful, your local checkout directory is then | |
| 78 | +switched to the tip of that branch, so subsequent commits don’t need the | |
| 79 | +“`--branch`” option. You have to switch back to the parent branch | |
| 80 | +explicitly, as with | |
| 81 | + | |
| 82 | + fossil update trunk # return to parent, “trunk” in this case | |
| 83 | + | |
| 84 | +Fossil does also support the Git style, creating the branch ahead of | |
| 85 | +need: | |
| 86 | + | |
| 87 | + fossil branch new my-new-branch | |
| 88 | + fossil update my-new-branch | |
| 89 | + ...work on first commit... | |
| 90 | + fossil commit | |
| 91 | + | |
| 92 | +This is more verbose, but it has the same effect: put the first commit | |
| 93 | +onto `my-new-branch` and switch the checkout directory to that branch so | |
| 94 | +subsequent commits are descendants of that initial branch commit. | |
| 95 | + | |
| 96 | +Fossil also allows you to move a check-in to a different branch | |
| 80 | 97 | *after* you commit it, using the "`fossil amend`" command. |
| 81 | 98 | For example: |
| 82 | 99 | |
| 83 | 100 | fossil amend current --branch my-new-branch |
| 101 | + | |
| 102 | +(“current” is one of the [special check-in names][scin] in Fossil. See | |
| 103 | +that document for the many other names you can give to “`amend`”.) | |
| 104 | + | |
| 105 | +[scin]: ./checkin_names.wiki | |
| 84 | 106 | |
| 85 | 107 | ## Autosync |
| 86 | 108 | |
| 87 | 109 | Fossil has a feature called "[autosync][5]". Autosync defaults on. |
| 88 | 110 | When autosync is enabled, Fossil automatically pushes your changes |
| 89 | 111 |
| --- www/gitusers.md | |
| +++ www/gitusers.md | |
| @@ -65,24 +65,46 @@ | |
| 65 | If you only want to commit just some of the changes, you can list the names |
| 66 | of the files you want to commit as arguments, like this: |
| 67 | |
| 68 | fossil commit src/main.c doc/readme.md |
| 69 | |
| 70 | ## Create Branches After-The-Fact |
| 71 | |
| 72 | Fossil perfers that you create new branches when you commit using |
| 73 | the "`--branch` _BRANCH-NAME_" command-line option. For example: |
| 74 | |
| 75 | fossil commit --branch my-new-branch |
| 76 | |
| 77 | It is not necessary to create branches ahead of time, as in Git, though |
| 78 | that is allowed using the "`fossil branch new`" command, if you |
| 79 | prefer. Fossil also allows you to move a check-in to a different branch |
| 80 | *after* you commit it, using the "`fossil amend`" command. |
| 81 | For example: |
| 82 | |
| 83 | fossil amend current --branch my-new-branch |
| 84 | |
| 85 | ## Autosync |
| 86 | |
| 87 | Fossil has a feature called "[autosync][5]". Autosync defaults on. |
| 88 | When autosync is enabled, Fossil automatically pushes your changes |
| 89 |
| --- www/gitusers.md | |
| +++ www/gitusers.md | |
| @@ -65,24 +65,46 @@ | |
| 65 | If you only want to commit just some of the changes, you can list the names |
| 66 | of the files you want to commit as arguments, like this: |
| 67 | |
| 68 | fossil commit src/main.c doc/readme.md |
| 69 | |
| 70 | ## Create Branches At Point Of Need, Rather Than Ahead of Need |
| 71 | |
| 72 | Fossil prefers that you create new branches as part of the first commit |
| 73 | on that branch: |
| 74 | |
| 75 | fossil commit --branch my-new-branch |
| 76 | |
| 77 | If that commit is successful, your local checkout directory is then |
| 78 | switched to the tip of that branch, so subsequent commits don’t need the |
| 79 | “`--branch`” option. You have to switch back to the parent branch |
| 80 | explicitly, as with |
| 81 | |
| 82 | fossil update trunk # return to parent, “trunk” in this case |
| 83 | |
| 84 | Fossil does also support the Git style, creating the branch ahead of |
| 85 | need: |
| 86 | |
| 87 | fossil branch new my-new-branch |
| 88 | fossil update my-new-branch |
| 89 | ...work on first commit... |
| 90 | fossil commit |
| 91 | |
| 92 | This is more verbose, but it has the same effect: put the first commit |
| 93 | onto `my-new-branch` and switch the checkout directory to that branch so |
| 94 | subsequent commits are descendants of that initial branch commit. |
| 95 | |
| 96 | Fossil also allows you to move a check-in to a different branch |
| 97 | *after* you commit it, using the "`fossil amend`" command. |
| 98 | For example: |
| 99 | |
| 100 | fossil amend current --branch my-new-branch |
| 101 | |
| 102 | (“current” is one of the [special check-in names][scin] in Fossil. See |
| 103 | that document for the many other names you can give to “`amend`”.) |
| 104 | |
| 105 | [scin]: ./checkin_names.wiki |
| 106 | |
| 107 | ## Autosync |
| 108 | |
| 109 | Fossil has a feature called "[autosync][5]". Autosync defaults on. |
| 110 | When autosync is enabled, Fossil automatically pushes your changes |
| 111 |