# Double deploy at same commit

**URL:** <https://answers.netlify.com/t/double-deploy-at-same-commit/110162>\
**Category:** Support\
**Tags:** git, building, deployment\
**Created:** [January 11, 2024, 10:39am UTC](https://answers.netlify.com/t/double-deploy-at-same-commit/110162 "2024-01-11T10:39:03Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![dedonnodev](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/dedonnodev/32/57861_2.png) [@dedonnodev](https://answers.netlify.com/u/dedonnodev)\
**Post date:** [January 11, 2024, 10:39am UTC](https://answers.netlify.com/t/double-deploy-at-same-commit/110162/1 "2024-01-11T10:39:03Z")

</div>

Hi there,  
my site [pem-frontstage.netlify.app](https://pem-frontstage.netlify.app)’s deploy is configured using a gitlab repo, but at each commit it build and deploy twice. I can’t understand why it behaves like this. I searched and also asked the AI (who doesn’t answer me) but I can’t find a solution.

 ![immagine](https://global.discourse-cdn.com/netlify/original/3X/b/f/bf0720776cd165430135653991ca7f76d8751a3a.png)

---

<div class="post-metadata">

**Author:** ![SamO](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/samo/32/41847_2.png) [@SamO](https://answers.netlify.com/u/SamO)\
**Post date:** [January 11, 2024, 7:36pm UTC](https://answers.netlify.com/t/double-deploy-at-same-commit/110162/2 "2024-01-11T19:36:24Z")

</div>

Hi @dedonnodev 👋🏿 welcome to the forums! This is because of continuous deployment so every time you push a commit to your repo Netlify will automatically run your build and deploy the result.

If you want to pause automatic publishing of your production branch, you can lock a deploy and stop auto-publishing to your site’s designated production branch. To change the production branch name, go to **Site configuration** \> **Build & deploy** \> **Continuous Deployment** \> **Branches and deploy contexts** , and select **Configure.**

---

<div class="post-metadata">

**Author:** ![dedonnodev](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/dedonnodev/32/57861_2.png) [@dedonnodev](https://answers.netlify.com/u/dedonnodev)\
**Post date:** [January 12, 2024, 5:56pm UTC](https://answers.netlify.com/t/double-deploy-at-same-commit/110162/3 "2024-01-12T17:56:13Z")

</div>

Hi @SamO, thanks for the answer, but the problem is that with each commit it performs a double build and deploy.

As you can see from the screenshot, the commit is the same but it has done two builds and two deployments.

---

<div class="post-metadata">

**Author:** ![hrishikesh](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/hrishikesh/32/74607_2.png) [@hrishikesh](https://answers.netlify.com/u/hrishikesh)\
**Post date:** [January 13, 2024, 5:19pm UTC](https://answers.netlify.com/t/double-deploy-at-same-commit/110162/4 "2024-01-13T17:19:48Z")

</div>

This is a common issue with GitLab. Go to your repo’s webhook’s settings and make sure there’s just a single webhook pointing to Netlify.

---

<div class="post-metadata">

**Author:** ![dedonnodev](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/dedonnodev/32/57861_2.png) [@dedonnodev](https://answers.netlify.com/u/dedonnodev)\
**Post date:** [January 15, 2024, 1:51pm UTC](https://answers.netlify.com/t/double-deploy-at-same-commit/110162/5 "2024-01-15T13:51:06Z")

</div>

Hi @hrishikesh, the problem is that i do not use webhook with gitlab. I directly linked the repo to netlify and it build and deploy automatically. But it does it twice for each commit

---

<div class="post-metadata">

**Author:** ![luke](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/luke/32/39_2.png) [@luke](https://answers.netlify.com/u/luke)\
**Post date:** [January 16, 2024, 3:28am UTC](https://answers.netlify.com/t/double-deploy-at-same-commit/110162/6 "2024-01-16T03:28:47Z")

</div>

Hi, @dedonnodev. At GitLab, Netlify automatically creates the webhook for new commits for you via the GitLab API. This means that GitLab is definitely using webhooks to tell Netlify when to build, even if you did not personally add those webhook to the GitLab repo.

The usual root cause is that the site has been linked to two site or re-linked to the existing site. The API call that makes the webhook will do so each time the repo is linked. However, it doesn’t check to see if the webhook already exists which then results in two webhooks existing when only one is required.

Again, if you would please check for duplicate webhook in the GitLab repo, that is nearly always the root cause of this type of issue.

---

<div class="post-metadata">

**Author:** ![dedonnodev](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/dedonnodev/32/57861_2.png) [@dedonnodev](https://answers.netlify.com/u/dedonnodev)\
**Post date:** [January 20, 2024, 10:54am UTC](https://answers.netlify.com/t/double-deploy-at-same-commit/110162/7 "2024-01-20T10:54:06Z")

</div>

Thank you all so much, now I understand what you meant.
