Skip to content

Commit 414d2b5

Browse files
committed
feat: Adding main as a default branch as per latest GitHub defaults.
1 parent 70ba733 commit 414d2b5

File tree

14 files changed

+40
-34
lines changed

14 files changed

+40
-34
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ For more information head to the [project site](https://idc101.github.io/git-mkv
1616
- Tag the current commit with the next version number
1717

1818
Works out of the box with trunk based development, GitFlow and GithubFlow. Alternatively all of this can be configured
19-
based on the branch name so release/master branches get different version numbers to develop or feature branches.
19+
based on the branch name so release/main branches get different version numbers to develop or feature branches.
2020

2121
## Installation
2222

docs/branching_models.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Branching Models
22

33
Below are some popular git branching development models and how to configure them with git-mkver:
4-
- master (aka trunk) based development
4+
- main (aka trunk) based development
55
- Git flow
66
- GitHub flow
77

@@ -11,17 +11,17 @@ Regardless of the branching strategy, git-mkver uses the commit messages to dete
1111

1212
See [Usage](usage) for more details.
1313

14-
## master (aka trunk) based development
14+
## main (aka trunk) based development
1515

1616
This mode of operation works out of the box with the default configuration.
1717

1818
Overview:
1919

20-
- Developers commit to master or work on feature branches
21-
- All releases are done from the master branch
22-
- Only the master branch is tagged
20+
- Developers commit to main or work on feature branches
21+
- All releases are done from the main branch
22+
- Only the main branch is tagged
2323
- Release Candidates are not used
24-
- Any version number not from master includes build metadata to indicate it is not an official release
24+
- Any version number not from main includes build metadata to indicate it is not an official release
2525

2626
### Build Server Setup
2727

docs/config_examples.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ format for Docker tags like so:
3737
```hocon
3838
branches: [
3939
{
40-
pattern: "master"
40+
pattern: "main"
4141
includeBuildMetaData: false
4242
tag: true
4343
formats: [

docs/config_reference.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ git-mkver will search for config in this order:
99
- `mkver.conf` in the current working directory
1010

1111
The application uses the HOCON format. More details on the specification can be found
12-
[here](https://github.com/lightbend/config/blob/master/HOCON.md).
12+
[here](https://github.com/lightbend/config/blob/main/HOCON.md).
1313

1414
Environment variables can be resolved in the config using the syntax `${?ENV_VAR_NAME}`.
1515

@@ -65,7 +65,7 @@ defaults {
6565
# branches are tried for matches in order
6666
branches: [
6767
{
68-
pattern: "master"
68+
pattern: "main"
6969
tag: true
7070
includeBuildMetaData: false
7171
}

docs/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
- Many others, fully configurable
1515
- Tag the current commit with the next version
1616
- Works with all branching strategies:
17-
- [master/trunk based development](https://trunkbaseddevelopment.com/)
17+
- [main/trunk based development](https://trunkbaseddevelopment.com/)
1818
- [Git Flow](https://nvie.com/posts/a-successful-git-branching-model/)
1919
- [GitHub Flow](https://guides.github.com/introduction/flow/)
2020

21-
All of this can be configured based on the branch name so release/master
21+
All of this can be configured based on the branch name so release/main
2222
branches get different version numbers to develop or feature branches.
2323

2424
## Getting started

docs/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ brew install idc101/gitmkver/git-mkver
2121
Install with [scoop](https://scoop.sh):
2222

2323
```cmd
24-
scoop install https://raw.githubusercontent.com/idc101/git-mkver/master/etc/scoop/git-mkver.json
24+
scoop install https://raw.githubusercontent.com/idc101/git-mkver/main/etc/scoop/git-mkver.json
2525
```
2626

2727
## Manual

docs/test.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<script src="https://cdn.jsdelivr.net/npm/@gitgraph/js"></script>
44

5-
<div id="master-version-inc-container"></div>
5+
<div id="main-version-inc-container"></div>
66

77
<!-- Use the `GitgraphJS` global variable to create your graph -->
88
<script>
@@ -26,16 +26,16 @@ var withoutHash = GitgraphJS.templateExtend(GitgraphJS.TemplateName.Metro, {
2626

2727
function f1() {
2828
// Get the graph container HTML element.
29-
const graphContainer = document.getElementById("master-version-inc-container");
29+
const graphContainer = document.getElementById("main-version-inc-container");
3030

3131
// Instantiate the graph.
3232
const gitgraph = GitgraphJS.createGitgraph(graphContainer, {
3333
template: withoutHash,
3434
});
3535

3636
// Simulate git commands with Gitgraph API.
37-
const master = gitgraph.branch("master");
38-
master
37+
const main = gitgraph.branch("main");
38+
main
3939
.commit("some code").tag("v4.2.5")
4040
.commit("feat: some more code").tag("v4.3.0")
4141
.commit("fix: a fix")
@@ -53,6 +53,6 @@ function f1() {
5353
//develop.merge(aFeature);
5454
//develop.commit("Prepare v1");
5555

56-
//master.merge(develop).tag("v1.0.0");
56+
//main.merge(develop).tag("v1.0.0");
5757
}
5858
</script>

src/main/resources/reference.conf

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# The reference config is suitable for basic master based SemVer development
2-
# - releases are done from master
1+
# The reference config is suitable for basic master/main based SemVer development
2+
# - releases are done from main
33
# - no other branches will be tagged
44
mode: SemVer
55
tagPrefix: v
@@ -19,6 +19,11 @@ branches: [
1919
tag: true
2020
includeBuildMetaData: false
2121
}
22+
{
23+
pattern: "main"
24+
tag: true
25+
includeBuildMetaData: false
26+
}
2227
]
2328
commitMessageActions: [
2429
{

src/main/scala/net/cardnell/mkver/AppConfig.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ object AppConfig {
187187
)
188188
val defaultBranchConfigs: List[BranchConfig] = List(
189189
BranchConfig("master", Some(true), None, None, None, Some(false), None, None, None),
190+
BranchConfig("main", Some(true), None, None, None, Some(false), None, None, None),
190191
BranchConfig("rel[/-].*", Some(true), None, None, None, Some(false), None, None, None),
191192
BranchConfig("release[/-].*", Some(true), None, None, None, Some(false), None, None, None),
192193
BranchConfig("hotfix[/-].*", Some(true), None, None, None, Some(false), None, None, None)

src/test/resources/test-config1.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ defaults {
1616
}
1717
branches: [
1818
{
19-
pattern: "master"
19+
pattern: "main"
2020
versionFormat: Version
2121
tag: true
2222
}

0 commit comments

Comments
 (0)