diff --git a/.all-contributorsrc b/.all-contributorsrc
index 6b0deed1..afb46b4b 100644
--- a/.all-contributorsrc
+++ b/.all-contributorsrc
@@ -672,7 +672,8 @@
"avatar_url": "https://avatars2.githubusercontent.com/u/357379?v=4",
"profile": "http://chrisswithinbank.net/",
"contributions": [
- "doc"
+ "doc",
+ "code"
]
},
{
diff --git a/README.md b/README.md
index a0b5a136..05afa5c6 100644
--- a/README.md
+++ b/README.md
@@ -72,7 +72,7 @@ These wonderful folks are responsible for developing and maintaining Netlify CMS
| [
Etienne Bernard](https://github.com/ebernard)
[π](https://github.com/netlify/netlify-cms/commits?author=ebernard "Documentation") | [
Eli Williamson](http://eliwilliamson.com)
[π»](https://github.com/netlify/netlify-cms/commits?author=eliwilliamson "Code") [π¨](#design-eliwilliamson "Design") | [
Covington Doan](https://www.covingtondoan.com)
[π](https://github.com/netlify/netlify-cms/commits?author=covingtondoan "Documentation") | [
Lennart Ziburski](http://lennartziburski.com)
[π»](https://github.com/netlify/netlify-cms/commits?author=ziburski "Code") [π¨](#design-ziburski "Design") [π](https://github.com/netlify/netlify-cms/commits?author=ziburski "Documentation") | [
Darrel O'Pry](http://darrelopry.com)
[π»](https://github.com/netlify/netlify-cms/commits?author=dopry "Code") [π](#infra-dopry "Infrastructure (Hosting, Build-Tools, etc)") [β οΈ](https://github.com/netlify/netlify-cms/commits?author=dopry "Tests") | [
Erin Symons](https://github.com/yourfrienderin)
[π](https://github.com/netlify/netlify-cms/commits?author=yourfrienderin "Documentation") | [
Austin Green](https://github.com/AustinGreen)
[π](https://github.com/netlify/netlify-cms/commits?author=AustinGreen "Documentation") [π‘](#example-AustinGreen "Examples") |
| [
Bryan Robinson](http://bryanlrobinson.com)
[π](https://github.com/netlify/netlify-cms/commits?author=brob "Documentation") | [
Darren](https://github.com/dardub)
[π](https://github.com/netlify/netlify-cms/commits?author=dardub "Documentation") | [
Richard Pullinger](http://www.richardpullinger.com)
[π»](https://github.com/netlify/netlify-cms/commits?author=rpullinger "Code") | [
Taylor Bryant](https://taylorbryant.blog)
[π](https://github.com/netlify/netlify-cms/commits?author=taylorbryant "Documentation") | [
kvanerkelens](https://github.com/kvanerkelens)
[π](https://github.com/netlify/netlify-cms/commits?author=kvanerkelens "Documentation") | [
Patrick Sier](https://patsier.com/)
[π»](https://github.com/netlify/netlify-cms/commits?author=pjsier "Code") | [
Christian Nolte](http://noltech.net)
[π»](https://github.com/netlify/netlify-cms/commits?author=drlogout "Code") |
| [
Edward Betts](http://edwardbetts.com/)
[π](https://github.com/netlify/netlify-cms/commits?author=EdwardBetts "Documentation") | [
Josh Hardman](https://github.com/jhardman0830)
[π](https://github.com/netlify/netlify-cms/commits?author=jhardman0830 "Documentation") | [
Mantas](https://behance.net/mistermantas)
[π](https://github.com/netlify/netlify-cms/commits?author=mistermantas "Documentation") | [
Marco Biedermann](https://www.marcobiedermann.com)
[π](https://github.com/netlify/netlify-cms/commits?author=marcobiedermann "Documentation") | [
Max Stoiber](https://mxstbr.blog/newsletter)
[π](https://github.com/netlify/netlify-cms/commits?author=mxstbr "Documentation") | [
Vyacheslav Matyukhin](http://berekuk.ru)
[π](https://github.com/netlify/netlify-cms/commits?author=berekuk "Documentation") | [
jimmaaay](https://jimmythompson.me)
[π»](https://github.com/netlify/netlify-cms/commits?author=jimmaaay "Code") |
-| [
LuΓs Miguel](https://github.com/Quicksaver)
[π](https://github.com/netlify/netlify-cms/issues?q=author%3AQuicksaver "Bug reports") [π»](https://github.com/netlify/netlify-cms/commits?author=Quicksaver "Code") | [
Chris Swithinbank](http://chrisswithinbank.net/)
[π](https://github.com/netlify/netlify-cms/commits?author=delucis "Documentation") | [
remmah](https://github.com/remmah)
[π](https://github.com/netlify/netlify-cms/commits?author=remmah "Documentation") | [
Sumeet Jain](http://sumeetjain.com)
[π](https://github.com/netlify/netlify-cms/commits?author=sumeetjain "Documentation") | [
Sagar Khatri](https://github.com/ragasirtahk)
[π](https://github.com/netlify/netlify-cms/commits?author=ragasirtahk "Documentation") [π‘](#example-ragasirtahk "Examples") | [
Kevin Doocey](https://www.dooceykev.in)
[π»](https://github.com/netlify/netlify-cms/commits?author=Doocey "Code") | [
Swieckowski](https://www.linkedin.com/in/arthur-swieckowski/)
[π»](https://github.com/netlify/netlify-cms/commits?author=Swieckowski "Code") [π](https://github.com/netlify/netlify-cms/commits?author=Swieckowski "Documentation") [β οΈ](https://github.com/netlify/netlify-cms/commits?author=Swieckowski "Tests") |
+| [
LuΓs Miguel](https://github.com/Quicksaver)
[π](https://github.com/netlify/netlify-cms/issues?q=author%3AQuicksaver "Bug reports") [π»](https://github.com/netlify/netlify-cms/commits?author=Quicksaver "Code") | [
Chris Swithinbank](http://chrisswithinbank.net/)
[π](https://github.com/netlify/netlify-cms/commits?author=delucis "Documentation") [π»](https://github.com/netlify/netlify-cms/commits?author=delucis "Code") | [
remmah](https://github.com/remmah)
[π](https://github.com/netlify/netlify-cms/commits?author=remmah "Documentation") | [
Sumeet Jain](http://sumeetjain.com)
[π](https://github.com/netlify/netlify-cms/commits?author=sumeetjain "Documentation") | [
Sagar Khatri](https://github.com/ragasirtahk)
[π](https://github.com/netlify/netlify-cms/commits?author=ragasirtahk "Documentation") [π‘](#example-ragasirtahk "Examples") | [
Kevin Doocey](https://www.dooceykev.in)
[π»](https://github.com/netlify/netlify-cms/commits?author=Doocey "Code") | [
Swieckowski](https://www.linkedin.com/in/arthur-swieckowski/)
[π»](https://github.com/netlify/netlify-cms/commits?author=Swieckowski "Code") [π](https://github.com/netlify/netlify-cms/commits?author=Swieckowski "Documentation") [β οΈ](https://github.com/netlify/netlify-cms/commits?author=Swieckowski "Tests") |
| [
Tim Carry](http://www.pixelastic.com/)
[π»](https://github.com/netlify/netlify-cms/commits?author=pixelastic "Code") [π¨](#design-pixelastic "Design") [π](https://github.com/netlify/netlify-cms/commits?author=pixelastic "Documentation") | [
Sol Park](https://github.com/solpark)
[π»](https://github.com/netlify/netlify-cms/commits?author=solpark "Code") | [
Michael Romani](https://github.com/MichaelRomani)
[π»](https://github.com/netlify/netlify-cms/commits?author=MichaelRomani "Code") | [
Xifeng Jin](http://linkedin/in/xifengjin88)
[π](https://github.com/netlify/netlify-cms/issues?q=author%3Axifengjin88 "Bug reports") [π»](https://github.com/netlify/netlify-cms/commits?author=xifengjin88 "Code") | [
Pedro Duarte](http://pedroduarte.me)
[π](https://github.com/netlify/netlify-cms/issues?q=author%3Apeduarte "Bug reports") [π»](https://github.com/netlify/netlify-cms/commits?author=peduarte "Code") [π](https://github.com/netlify/netlify-cms/commits?author=peduarte "Documentation") | [
Antonio Argote](http://antonioargote.com)
[π¨](#design-Strangehill "Design") | [
Kristaps Taube](https://www.ktaube.com)
[π»](https://github.com/netlify/netlify-cms/commits?author=ktaube "Code") |
| [
David Ko](https://github.com/daveyko)
[π»](https://github.com/netlify/netlify-cms/commits?author=daveyko "Code") | [
IΓ±aki GarcΓa](http://www.txorua.com)
[π¨](#design-igarbla "Design") | [
Sam](https://github.com/gazebosx3)
[π»](https://github.com/netlify/netlify-cms/commits?author=gazebosx3 "Code") | [
Josh Dzielak](https://dzello.com)
[π](https://github.com/netlify/netlify-cms/commits?author=dzello "Documentation") | [
Jeremy Bise](http://thosegeeks.com)
[π](https://github.com/netlify/netlify-cms/commits?author=jeremybise "Documentation") | [
terrierscript](https://terrierscript.com)
[π»](https://github.com/netlify/netlify-cms/commits?author=terrierscript "Code") | [
Christopher Geary](https://twitter.com/crgeary)
[π](#plugin-crgeary "Plugin/utility libraries") |
| [
Brian Macdonald](https://github.com/brianlmacdonald)
[π»](https://github.com/netlify/netlify-cms/commits?author=brianlmacdonald "Code") | [
John Vandenberg](https://jayvdb.github.io/)
[π](https://github.com/netlify/netlify-cms/commits?author=jayvdb "Documentation") | [
MarkZither](https://github.com/MarkZither)
[π](https://github.com/netlify/netlify-cms/commits?author=MarkZither "Documentation") | [
Rob Phoenix](https://www.robphoenix.com)
[π](https://github.com/netlify/netlify-cms/commits?author=robphoenix "Documentation") | [
Steve Lathrop](https://www.SteLa.io)
[π»](https://github.com/netlify/netlify-cms/commits?author=slathrop "Code") [π](https://github.com/netlify/netlify-cms/commits?author=slathrop "Documentation") [π‘](#example-slathrop "Examples") | [
Maciej Matuszewski](https://github.com/maciejmatu)
[π»](https://github.com/netlify/netlify-cms/commits?author=maciejmatu "Code") | [
Eko Eryanto](https://github.com/ekoeryanto)
[π](#plugin-ekoeryanto "Plugin/utility libraries") |
diff --git a/src/backends/git-gateway/implementation.js b/src/backends/git-gateway/implementation.js
index 447c5324..fe9b8ea0 100644
--- a/src/backends/git-gateway/implementation.js
+++ b/src/backends/git-gateway/implementation.js
@@ -70,6 +70,7 @@ export default class GitGateway extends GitHubBackend {
branch: this.branch,
tokenPromise: this.tokenPromise,
commitAuthor: pick(userData, ["name", "email"]),
+ squash_merges: this.squash_merges,
});
return userData;
} else {
diff --git a/src/backends/github/API.js b/src/backends/github/API.js
index 459524dd..783bb041 100644
--- a/src/backends/github/API.js
+++ b/src/backends/github/API.js
@@ -15,6 +15,7 @@ export default class API {
this.branch = config.branch || "master";
this.repo = config.repo || "";
this.repoURL = `/repos/${ this.repo }`;
+ this.merge_method = config.squash_merges ? "squash" : "merge";
}
user() {
@@ -635,6 +636,7 @@ export default class API {
body: JSON.stringify({
commit_message: "Automatically generated. Merged on Netlify CMS.",
sha: headSha,
+ merge_method: this.merge_method,
}),
})
.catch((error) => {
diff --git a/src/backends/github/implementation.js b/src/backends/github/implementation.js
index 2663e15d..2fa63f4b 100644
--- a/src/backends/github/implementation.js
+++ b/src/backends/github/implementation.js
@@ -17,6 +17,7 @@ export default class GitHub {
this.branch = config.getIn(["backend", "branch"], "master").trim();
this.api_root = config.getIn(["backend", "api_root"], "https://api.github.com");
this.token = '';
+ this.squash_merges = config.getIn(["backend", "squash_merges"]);
}
authComponent() {
@@ -29,7 +30,7 @@ export default class GitHub {
authenticate(state) {
this.token = state.token;
- this.api = new API({ token: this.token, branch: this.branch, repo: this.repo, api_root: this.api_root });
+ this.api = new API({ token: this.token, branch: this.branch, repo: this.repo, api_root: this.api_root, squash_merges: this.squash_merges });
return this.api.user().then(user =>
this.api.hasWriteAccess().then((isCollab) => {
// Unauthorized user
diff --git a/website/site/content/docs/beta-features.md b/website/site/content/docs/beta-features.md
index 47e6fada..e0ed55b9 100644
--- a/website/site/content/docs/beta-features.md
+++ b/website/site/content/docs/beta-features.md
@@ -77,3 +77,14 @@ import styles from '!css-loader!sass-loader!../main.scss'
CMS.registerPreviewStyle(styles.toString(), { raw: true })
```
+## Squash merge GitHub pull requests
+When using the [Editorial Workflow](/docs/configuration-options/#publish-mode) with the `github` or `git-gateway` backends, Netlify CMS creates a pull request for each unpublished entry. Every time the unpublished entry is changed and saved, a new commit is added to the pull request. When the entry is published, the pull request is merged, and all of those commits are added to your project commit history in a merge commit.
+
+The squash merge option causes all commits to be "squashed" into a single commit when the pull request is merged, and the resulting commit is rebased onto the target branch, avoiding the merge commit altogether.
+
+To enable this feature, you can set the following option in your `config.yml`:
+
+```yaml
+backend:
+ squash_merges: true
+```