GitHub Pages #175710
Replies: 5 comments 17 replies
-
It sounds like your repository was published via GitHub Pages, and the README.md got picked as the homepage. To fix it: Go to Settings → Pages in your repo. Under Source, select the correct branch/folder (e.g., main and /root or /docs) that contains your website files. Save and wait a few minutes; your site should update. Deleting README.md alone doesn’t reset Pages—it needs the source branch/folder set correctly. ✅ Hope this helps! Please mark it as the answer if it works. |
Beta Was this translation helpful? Give feedback.
-
Hey @IParsaRaza It sounds like your README.md file got picked up as the homepage for your GitHub Pages site. Don't worry, you can fix this! Here’s what you need to do: Go to your repository's Settings. Scroll down to the Pages section. Under the Source dropdown, make sure to select the correct branch (usually main) and the folder that holds your website files (like /root or /docs). Save the changes and give it a few minutes. The reason deleting the README.md file didn’t fix it is because GitHub Pages is still looking at that as the homepage. Once you reset the source branch/folder, it will point to your actual website files instead. Let me know if you run into any issues after that! 😊 |
Beta Was this translation helpful? Give feedback.
-
its the common github problem solution:- Step1 - Go to your GitHub repository. Step 2: Make Sure You Have an index.html GitHub Pages needs an index.html file in your selected branch/folder. Check that your repo has one. If not, create one (even a basic test one like this): <title>My Website</title>Hello from my site!Commit & push this file to the same branch as your Pages source (e.g. main). Step 3: Rebuild GitHub Pages After saving or pushing, go back to Settings → Pages. Wait 1–2 minutes for GitHub to rebuild the site. Open your GitHub Pages link (something like https://yourusername.github.io/repo-name/). Step 4: (Optional) Clear Cache If the old README version still shows: Hard-refresh (Ctrl + Shift + R). Or open the site in incognito mode. If you tell me: 🔹 your repo name, and 🔹 what branch your site files are in (e.g., main, gh-pages, or /docs) I can tell you exactly what to click or fix next. |
Beta Was this translation helpful? Give feedback.
-
The most likely fix is to force a fresh Pages deploy on the correct source with an explicit index.html and a .nojekyll file. When Pages cannot find an index it falls back to rendering README with Jekyll and that state can linger. Adding .nojekyll stops the README pipeline and a new deploy replaces the cached output. Create or restore your site files in the folder you use for Pages. Set Pages to that branch and folder in Settings. Then add these two files and commit. <!-- index.html -->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Site is back</title>
</head>
<body>
<h1>Hello from GitHub Pages</h1>
<p>If you can see this, the site is serving index.html instead of README.md.</p>
</body>
</html> Also add an empty file named .nojekyll in the same directory as index.html. This tells Pages to serve your static files exactly as they are. After pushing, open Settings then Pages and confirm the latest deployment shows success. Visit your Pages URL and you should see the new index. If it still shows the old README view, disable Pages, wait a minute, then enable it again on the intended branch and folder. That forces a clean deployment and clears the stale build. If this solved the issue please mark the answer as helpful so others can find it. |
Beta Was this translation helpful? Give feedback.
-
Make an empty file called .nojekyll and add an index.html file to the / or /docs directory of the repo where the website should be created The new page (once deployed) will link to the index.html file not the README file Also, if using a framework like Next JS, you should compile it to a static site before deploying it to GitHub |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Question
Body
So....before I was trying to edit my code to make so it can come thru a website, but then i started making a README.md file, and that accidentally became the website, and even if I delete the file it doesn't allow me to go back to making the actual website public into a website. PLZZZZZZ help me 🥺
Beta Was this translation helpful? Give feedback.
All reactions