Git 블로그 404 - Git beullogeu 404

You can display a custom 404 error page when people try to access nonexistent pages on your site.

GitHub Pages is available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see "GitHub's products."

  1. On GitHub, navigate to your site's repository.

  2. Navigate to the publishing source for your site. For more information, see "Configuring a publishing source for your GitHub Pages site."

  3. Above the list of files, using the Add file drop-down, click Create new file.

    Git 블로그 404 - Git beullogeu 404

  4. In the file name field, type 404.html or 404.md.

    Git 블로그 404 - Git beullogeu 404

  5. If you named your file 404.md, add the following YAML front matter to the beginning of the file:

    ---
    permalink: /404.html
    ---
    
  6. Below the YAML front matter, if present, add the content you want to display on your 404 page.

  7. At the bottom of the page, type a short, meaningful commit message that describes the change you made to the file. You can attribute the commit to more than one author in the commit message. For more information, see "Creating a commit with multiple co-authors."

    Git 블로그 404 - Git beullogeu 404

  8. If you have more than one email address associated with your account on GitHub.com, click the email address drop-down menu and select the email address to use as the Git author email address. Only verified email addresses appear in this drop-down menu. If you enabled email address privacy, then <username>@users.noreply.github.com is the default commit author email address. For more information, see "Setting your commit email address."

    Git 블로그 404 - Git beullogeu 404

  9. Below the commit message fields, decide whether to add your commit to the current branch or to a new branch. If your current branch is the default branch, you should choose to create a new branch for your commit and then create a pull request. For more information, see "Creating a new pull request."

    Git 블로그 404 - Git beullogeu 404

  10. Click Propose new file.

    Git 블로그 404 - Git beullogeu 404

Further reading

  • Front matter in the Jekyll documentation

안녕하세요 선생님! 선생님 말씀대로 GitHub Pages 설정에서 main으로 설정 후 세이브를 눌렀는데도 30분이 지나도 계속 해당 URL 접속 시 계속 404에러가 나타납니다 ㅠㅠㅠ

index.html파일도 잘 나타나고 구글링하여 리빌드 및 파일 추가하지 않은 채 빈 내용 커밋 다 해보았는데도 안되어 문의드립니다 ㅠㅠㅠ

접속 url - https://ytk0327.github.io/cat-jjal-maker/

Git 블로그 404 - Git beullogeu 404
Git 블로그 404 - Git beullogeu 404
Git 블로그 404 - Git beullogeu 404

Git & Github

[github] 홈페이지 만들기 (github pages, 웹 호스팅) | github pages 404 오류

heeney 2021. 10. 26. 16:08

github를 이용해서 무료로 웹 호스팅을 하는 방법을 알아보자.
회원 가입을 하고 계정이 있다는 가정 하에 진행한다.


1. New repository

Git 블로그 404 - Git beullogeu 404

github 홈페이지에 들어가서 상단에 +를 클릭 해서 보이는 New repository를 클릭한다.

Git 블로그 404 - Git beullogeu 404

들어가보면 사진과 같은 화면이 뜨는데,

  • Repository name: 리포지토리 이름이다.
    반드시 {사용자이름}.github.io로 정하라고 하지만 안해도 크게 상관은 없을 것 같다.
    그러나 제대로 작동하지 않을 수 있다는 내용이 있기에 안전하게 이름을 정하는 것도 방법이다.
  • Description: 선택사항으로 내 리포지토리에 대한 설명을 간략하게 붙인다.
  • Public or Private: 공개 or 비공개
  • Initialize this repository with: 해도 되고 안해도 됨, 어차피 지금 체크 안해도 나중에 생성 가능하고 Choose a license는 나의 상황에 맞추어 체크

모두 작성했다면 Create repository를 클릭한다.


원격 저장소와 로컬 저장소를 연결 🧤

처음 리포지토리를 만들면 깃헙이 잘 설명해주니 그대로 따라하면 된다.
깃헙 설명이 안나오는 분들을 위해 동일한 내용을 적어둔다.

바탕화면에 폴더 하나를 만들어주고 에디터 프로그램에서 열어준 뒤,

echo "# {리포지토리명}" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/{사용자명}/{리포지토리명}.git
git push -u origin main

순서대로 따라하면 원격 저장소와 연결된다.


2. Settings

Git 블로그 404 - Git beullogeu 404
Settings > Pages
Git 블로그 404 - Git beullogeu 404
main 클릭
Git 블로그 404 - Git beullogeu 404
Save 클릭
Git 블로그 404 - Git beullogeu 404

사이트가 완성되었다.

Git 블로그 404 - Git beullogeu 404
링크 클릭시 연결이 된 것을 확인할 수 있다.

github pages 링크 클릭시 404 에러가 뜰 때

Git 블로그 404 - Git beullogeu 404

1. index.html 붙여서 접속하기

your_name.github.io/repository_name/index.html

2. 파일 추가하지 않은 채 빈 내용 커밋

git commit --allow-empty -m "rebuild"
git push origin master