Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8638161
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:39:24+00:00 2026-06-12T10:39:24+00:00

I have a BitBucket account, and it will trigger a script on my sever

  • 0

I have a BitBucket account, and it will trigger a script on my sever that will pull and update the live server when a push is made. The trigger works, and after having a lot of troubles getting the _www user to trust the hgrc or whatever (I did get that working), it’s actually doing the command.

The problem is I get an error about not being able to lock the folder, which means that my _www user doesn’t have permission to the .hg folder.

What’s a good way to approach this? I don’t want to make the .hg folder 0777. I could put _www in the same group as my user (which I believe it is) and give the group rw (what is that, 0775?). Would that be acceptable, or are there other security implications I might be missing, or a better way to handle this.

I was I could run the command with my user. And maybe I can. BitBucket is using a POST service to post to my server and I do the command via PHP’s shell_exec() (it only runs the command if the request came from BitBucket’s IP).

[Update] I went ahead and tried setting the permissions to 0775, and it still didn’t work (_www isn’t in the same group as my user). Same error, which is:

abort: could not lock repository /path/to/local/repo: Permission denied

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T10:39:26+00:00Added an answer on June 12, 2026 at 10:39 am

    You’ve got the right idea with the groups stuff. You need to:

    • make sure the www user is in the same group as the group that owns everything in the .hg directory
    • make sure everything in the .hg directory is write-able by group (chmod -R g+w .hg)

    If any other users besides www will be pushing/pulling/updating in that repo then you’ll also want to use the sticky-group-bit to make sure that newly created files and directory have the same group ownership as the .hg directory itself.:

    find .hg -type d | xargs chmod g+s
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Git repository in bitbucket and another on my live rails server,
I have 2 repos: at the Bitbucket and at my own server. Bitbucket repo
I have a Bitbucket Git repository managed with Sourcetree. I have two folders that
I have a Bitbucket account for my 9-5 job and I also have a
I have encountered this error when trying to push a subrepository to bitbucket: D:\Work\agile.crm.framework>hg
I have a mercurial repository which halfway trough a 93meg push to bitbucket suddenly
I have an account at bitbucket, here is what i want to achieve. ME
I have a team set up on bitbucket with multiple users, and I'm using
I have a git repository hosted on BitBucket, and have set up SSH authentication
I have an existing Django app on Bitbucket and I'm able to deploy to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.