Git - local file changes in remote repository

Asked

Viewed 39 times

0

I have a settings file that exists in the remote repository and in place, with information for sending email.

In my local environment, I need to modify it with my private email account settings for testing. Eventually I will need to push the changes I made places, but first I will have to change these settings of my particular email; In other words, I... In most of the development I want that the changes of this file are not taken to the remote repository in push (only the changes of the other files), but in the end, I may need to push this file with some point changes.

I wanted to ignore this file in the push most of the time, but be able to "designate" when I want.

From what I read about . gitignore, it is not suitable as it serves for all developers to ignore such file.

I tried using . git/info/exclude, but when I make local changes,dou commit and push, the changes go to the github remote repository...

Can anyone help me? I’m skipping some steps?

Grateful in advance!

1 answer

0


What you need is an example configuration file and skip the configuration file you are using.

I don’t know what language you’re using, if you want to mention it, I can edit the answer.

Let me give you an example in PHP

Create the file .gitignore and place the following content:

config.php

Create the file config.php.example and place the following content

<?php
define('EMAIL', '');

Now copy the file config.php.example for config.php. Edit the file config.php and put your email. Like the file config.php is in the .gitignore he will not be commissioned.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.