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 7009133
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:49:26+00:00 2026-05-27T21:49:26+00:00

I have a setup as follows. A private repository at bitbucket where I keep

  • 0

I have a setup as follows.

A private repository at bitbucket where I keep the ‘master’ repository.
A repository on my server which acts as the ‘live’ website.
A repository on my laptop which acts as my working copy.

My process is as follows. I make a change to a file in my local repository. I commit these locally. I push these changes to bitbucket. I then pull these changes from my bitbucket to the webserver.

The problem that I have however is that my local copy utilizes different configuration settings for databases, paths etc, ergo what I want is my ‘config.php’ file at bitbucket to contain the server settings, and the config.php on my local host to contain local settings.

I believe this can be achieved with .hgignore but i have had no success researching.
The problem i encounter is that i make my server settings file, push it to bitbucket, ‘forget’ the file in my local repository, create a .hgignore, and then recreate the file. However when i ‘forget’ the file TortoiseHG notices and asks me to commit the change to bitbucket….

Any ideas would be greatly appreciated.
Thanks

Additional Points.

Following the advice below I have developed a setup as follows:

I have my local repository on my laptop where i do my edits.
I have bitbucket which is essentially the ‘main’ repository – if any other developers join the team they clone this.
I have my live repository on my web host.

On my live repository I have a .hgignore file whichs ignores the respective config files.
As such when I do hg pull from my host, it pulls the repository as is with the localhost configuration files, but when i type hg update (to the live working copy), these files are ignored/not updated.

Could someone clarify as to if i have understood this correctly, and as to whether this is a suitable way of achieving what I want?

Thanks

  • 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-05-27T21:49:27+00:00Added an answer on May 27, 2026 at 9:49 pm

    .hgignore only ignores files if they are not versioned already, so I don’t think your idea in the question will work.

    The common approach regarding local configuration is generally a variation on the same theme, like of one of the following:

    1. Do not check in the config.php at all. You can check in a config.example.php with the most common settings, and document in the README that users have to copy it to config.php and then edit it.

    2. Put any shared settings in config.php, and add an include statement to point to an unversioned file with settings specific to the machine, e.g. config.local.php. You can also provide an config.local.example.php-file for this.

    3. Like 2, but the config.php contains all default settings and the local file has the ability to override them.

    4. Check in a config.dev.php and config.server.php-file containing the settings for both environments, and then have an unversioned config.php which includes one of the above files. Advantage is that the configurations themselves are versioned and you can update them.

    Which of these variations to pick, or whether you make another variation, depends on your environment.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Our setup as follows: We have a local development server running Ubuntu, with a
I have a Pjs sketch, which looks as follows: void setup(){ //setup stuff among
I have setup a Django project on my laptop and build my first app.
I have setup web dav on windows server 2008. It seems to work fine
I have a table setup as follows: +---------------+ | resources | +---------------+ | id
Git beginner question: I have a small private webproject which is versioned locally with
I have a custom initializer setup as follows: public class PromptIfChangesNeededDBInitializer : IDatabaseInitializer<MeyerREContext> {
I have set up a bootstrapper as follows: private static IUnityContainer BuildUnityContainer() { var
I have some models setup as follows: public class Form { public int FormId
I have a database setup as follows (simplified): +----------+---------+----------+ | path | val1 |

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.