Skip to content

Commit 6482dc7

Browse files
committed
doc/WorkflowGuidelines.md: add tiny git guide
Related to: #115
1 parent 4ece0b2 commit 6482dc7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

docs/WorkflowGuidelines.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,15 @@ you) to find code that is commented/disabled.
178178
ends up being compiled and packaged in NuGet as a dotnet tool, for example: https://github.com/nblockchain/fsx/tree/master/fsxc
179179
* .NET APIs: PascalCase (see our [F# Style Guide](FSharpStyleGuide.md) for more info).
180180
* .NET parameters, local variables & nested functions: camelCase (again, see our [F# Style Guide](FSharpStyleGuide.md) for more info).
181+
182+
* Be mindful of the way we prefer to use git:
183+
* When rebasing a PR, never use the command `git merge` or the GitHubUI to update branches, otherwise you might get some "Merge" commits that make your commit history unreadable.
184+
* Merge commits are only acceptable when caused by merging a PR that has more than 1 commit (if PR only has one commit, it's better to merge it with the "Rebase" option that GitHub provides).
185+
* Don't confuse the command `git rebase -i HEAD~n` (where `-i` stands for 'interactive') with the non-interactive `git rebase` operation.
186+
* The former is for squashing commits or changing their order. By the way, be extremely careful when determining the number of commits `n` (if you put a number that is too high, even off by one, you might destroy previous merge commits).
187+
* The latter is for rebasing a branch or PR against, for example, `master` or `main`, but only if there have been no recent force-pushes in the branch you want to rebase against. If there have been force-pushes, then the safest way to rebase is by using the `git cherry-pick` command.
188+
* When using the command `git pull`, never ever ever forget the flag `--rebase`, otherwise git will introduce merge commits for you automatically.
189+
181190
* Git commit messages should follow this style:
182191

183192
```

0 commit comments

Comments
 (0)