# Pre Receive Hook Declined Error When Publishing Code to Git

**URL:** <https://forum.uipath.com/t/pre-receive-hook-declined-error-when-publishing-code-to-git/502979>\
**Category:** Knowledge Base\
**Tags:** activities\
**Created:** [December 29, 2022, 1:39pm UTC](https://forum.uipath.com/t/pre-receive-hook-declined-error-when-publishing-code-to-git/502979 "2022-12-29T13:39:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/system/32/182466_2.png) [@system](https://forum.uipath.com/u/system)\
**Post date:** [December 29, 2022, 1:39pm UTC](https://forum.uipath.com/t/pre-receive-hook-declined-error-when-publishing-code-to-git/502979/1 "2022-12-29T13:39:40Z")

</div>

# How to resolve the Error Pre-Receive Hook Declined, when publishing the code to GIT from UiPath Studio

## **Issue Description**

When publishing the code from UiPath Studio to Git, the "Pre-Receive Hook Declined" error is encountered.

The error message appears as shown in the screenshot below:

 ![](https://global.discourse-cdn.com/uipath/original/4X/b/4/9/b495525c5f3186ece22cd68930077b74c481868a.png)

## **Resolution**

This error originates from the Git remote branch, indicating that it is rejecting the commit performed. The following steps needs to be performed to resolve the issue:

1. Go to GitLab
2. Settings
3. Repository
4. Protected Branches
5. Unprotect the branch.
