Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

gitignore not working in bitbucket pipelines

aivantechllc
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 26, 2019

I have config settings that differ between prod and dev environment. When I take a pull in prod environment it is bringing in the dev config code too even though I have added them in git ignore file.

I need the config files to be isolated to each environment and need to exclude the config files from moving with the pipeline deployment. 

Currently the commit is showing the dev config files in the pull request when deploying to prod even though the config files are part of the git ignore file.

How do I prevent the dev config files from coming along in the prod deployment?

1 answer

1 vote
Philip Hodder
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 3, 2019

Hello,

Is your .gitignore file the same across all your branches? If not, can you paste in an example of it?

If the configuration files are being pushed to Bitbucket, it means it has already been included in your commit history. A gitignore file will only prevent the file from being added to a commit. It won't prevent it from being merged across branches.

An alternative approach would be to let your configuration files be added, but give them different names. The use a Deployment Variable in Pipelines to indicate which configuration file should be used in each deployment. 

Thanks,

Phil

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events