is it possible to have a textfile that uses only one line?

I have been coding a website and i am hosting it on github however i have run into a problem, my website has a raw txt file which i am using as a key for the app i have made. When i checked the key system with the app it said i was using the incorrect key so i checked the source code for the raw txt and it takes up two lines the first line contains the text i am using as the key and the second is just empty. i know the key system works with pastebin raw text so i checked the source code and ther was no extra line. I have tried to edit the text file in github and just remove the extra line but when i do so and then check the pages source code the extra line is still there. Does anybody know a way to remove the extra line because i really like having my website on github and would rather not use a different website to hold the raw txt file.

thanks in advance

I wonder if this might be due to the repository having an EditorConfig settings file (.editorconfig) enforcing empty lines at the end of text files. Many repositories rely on EditorConfig to enforce code styles consistency in source files; so if your repository was forked from a third party, or if it contains some third party libraries that ship with an .editorconfig file this might be reason — although I’m not sure whether GitHub’s WebUI does support EditorConfig or not, or whether it might be enforcing empty lines at the end of files by its own settings.

You should edit the file locally, commit and push to GitHub, so that you have full control over the process (unlike with the WebUI). Bear in mind that if the repository contains a .editorconfig file, many editors will automatically pickup its settings and enforce them.

Another thing you might want to consider is that GitHub’s WebUI is Linux based, so it always enforces Unix style end-of-line sequences (LF) whereas if you’re working on Windows your native EOL is going to be CRLF — a wrong EOL types could be breaking the key file also in the middle, not just the end. So, you also need to check what type of EOL (i.e. LF or CRLF) the original (unedited) key file uses, and then ensure that your repository will enforce the correct EOL type at checkin (via .giattributes settings).

If you could provide a link to the source repository, the key file, and the GH Pages website, this would greatly help us in helping you.