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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:39:26+00:00 2026-06-05T01:39:26+00:00

I want to modify some configuration strings in a git version controlled php script,

  • 0

I want to modify some configuration strings in a git version controlled php script, according to the environment I am using the code in the repository.

I want to set up a smudge/clean filter to modify the configuration string in the code according to the platform, I am checking out (dev/testing). My scripts are in ~/scripts and I want to add a config file ~/scripts/config to set values used by the script

I have different projects (in different repos) with the same files in it but they should be modified differently, so the script needs to know from which repository it was invoked.

Is there a way to set a project ID maybe in the .gitattributes file which is passed as an environment variable to the filter script?

EXAMPLE:

content of .gitattributes:

PROJECT_ID = "ProjectX"

content of smudge script (pseudo code):

host = getConfigValueFromFile(projectXhost)
if $PROJECT_ID == "ProjectX" then
    print 'host=$host'
  • 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-05T01:39:28+00:00Added an answer on June 5, 2026 at 1:39 am

    I have found an answer by myself:

    The clean/smudge script is executed with the (new) repos directory as the working directory. So it is possible to put a file e.g. .projectID in your repository and read its content in the smudge script.

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

Sidebar

Related Questions

I want to modify some code in the Eclipse JDT itself (In the Debug
The script I am working with is here: https://gist.github.com/2759751 I want to modify some
I have found some script on internet voting system, I want to modify it
I'm struggling with trying to modify some Javascript code. I know what I want
I want to modify some data on XML file residing on server side by
When we want to modify some value in one object we may use two
I want to modify an internal webpage to strip away some of the onclick
I want to modify glibc. So I have downloaded a version of it and
I want to copy a single record from a table, modify some of the
There are some tutorials out there telling me how to override PHP configuration when

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.