Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

couldn't see the .git/hooks in my local repo or remote bitbucket

Balasri sai chandana February 13, 2023

when I did git clone

performed git init

I want to add some stuff to the hooks file but cannot see it in my local repo or remote bitbucket though able to navigate in bash

Can you help to view it local repo or Remote bitbucket repo ?

1 answer

1 accepted

0 votes
Answer accepted
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 14, 2023

Hello @Balasri sai chandana ,

Thank you for reaching out to the Atlassian Community!

The git default path for hooks is .git/hooks and this folder is usually a hidden folder, so this is the reason why you do not see it when using file explorer such as Finder, but they do show in bash. 

Enabling the view of hidden folder vary depending on your Operating System, so you can check the below instructions for Windows and MacOS : 

With that in mind, the content of the ./git/hooks directory isn’t cloned with the rest of your project, nor is it under version control, so you will not be able to see it on the Bitbucket UI. This is because hooks are essentially meant to be local configurations.

However, you have the option to specify a different directory within your repo (outside .git folder) where git will look for the hooks scripts, so you would then be able to commit and push this directory to your repo. To instructions to implement this workaround are outlined in the following article : 

Hope that helps! In case you have any questions, please let us know!

Thank you, @Balasri sai chandana !

Patrik S

Balasri sai chandana February 16, 2023

Thank-you @Patrik S 

The information helped out

Suggest an answer

Log in or Sign up to answer
Site Admin
AUG Leaders

Atlassian Community Events