My First Fork: keeping config files local/not uploaded

I’ve forked an orphaned project that needs some changes to start working again. It links to an API which I send my login details to when I use the project. In the existing fork (and mine for now) the login details are left blank “For the user to complete” - and separated handily into a single file.

In order to test my changes though I need to add my login details to the local copy of the fork that I made with “Github Desktop” for Windows. I obviously don’t want to accidentally publish my username and password to the whole world so my question is:

Can I somehow mark a file to be “locked” or “ignore changes here” so that it doesn’t get uploaded when I commit new versions?

Hello @cleverbum,

Are you able to set environment variables in this login script? I was thinking you could then still upload the file and simply provide the variables at runtime when using the project.

Alternatively, you could add the file to your .gitignore to prevent it from being uploaded and that way the remote fork repo would have the original file, while your local copy would have the modified one containing your details and would never be uploaded to the repo.

1 Like

Hi @cleverbum,

What @matthewheath said about using environment variables or a .gitignore file is probably your best option. If you need more information, you may want to check out the GitHub help article, Ignoring files.


1 Like

Thanks - .gitignore is my friend here as I can’t use environment variables

1 Like