My First Fork: keeping config files local/not uploaded #22930
-
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? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
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. |
Beta Was this translation helpful? Give feedback.
-
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. Thanks! |
Beta Was this translation helpful? Give feedback.
-
Thanks - .gitignore is my friend here as I can’t use environment variables |
Beta Was this translation helpful? Give feedback.
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.