티스토리 뷰

GitHub

(macOS) github.io 블로그 생성

jinozpersona 2022. 1. 24. 15:16

INTRO

GitHub 회원가입 / repository 생성, (macOS) git 설정 / commit/push : 이전 글 확인

github.io repository 생성

index.html 생성 및 commit/push : hello github.io blog

 

1. github.io repository 생성

- Repositoty name 부분에 jinozpersona.github.io 형태로 생성 : Owner(username)과 동일하게 [username].github.io 생성

 

 

2. index.html 생성 및 commit/push 

 

 

git directory 생성 및 이동

$ mkdir jinozpersona.github.io
$ cd jinozpersona.github.io

 

git config 

$ git config --global user.name "[username]"
$ git config --global user.email "[email]" 

 

git 초기화

$ git init

 jinozpersona.github.io git:(master 

 

$ git branch -M main

 jinozpersona.github.io git:(main 

 

 

index.html 생성 및 내용 작성

git:(main) $ touch index.html
git:(main) $ nano index.html
hello jinozpersona.github.io blog

 

 

git commit/push

git:(main) $ git status

현재 브랜치 main

아직 커밋이 없습니다

추적하지 않는 파일:
  (커밋할 사항에 포함하려면 "git add <파일>..."을 사용하십시오)
index.html

커밋할 사항을 추가하지 않았지만 추적하지 않는 파일이 있습니다 (추적하려면 "git
add"를 사용하십시오)

 

git:(main) $ git add index.html
git:(main) $ git status

현재 브랜치 main

아직 커밋이 없습니다

커밋할 변경 사항:
  (스테이지 해제하려면 "git rm --cached <파일>..."을 사용하십시오)
새 파일:       index.html

 

git:(main) $ git commit -m "first commit index.html"

[main (최상위-커밋) f01919a] first commit index.html
 1 file changed, 1 insertion(+)
 create mode 100644 index.html

 

git:(main) $ git status

현재 브랜치 main
커밋할 사항 없음, 작업 폴더 깨끗함

 

 

git:(main) $ git remote add origin https://github.com/jinozpersona/jinozpersona.github.io.git
remote 상태 보기
git:(main) $ git remote -v
#참고 : remote 제거
git:(main) $ git remote remove origin

 

 

git:(main) $ git push -u origin main
#참고 : rejected error 발생 시 강제 push
! [rejected]        main -> main (fetch first)error: 레퍼런스를 'https://github.com/jinozpersona/jinozpersona.github.io.git'에 푸시하는데 실패했습니다
git:(main) $ git push -u origin +main

오브젝트 나열하는 중: 3, 완료.
오브젝트 개수 세는 중: 100% (3/3), 완료.
Delta compression using up to 8 threads
오브젝트 압축하는 중: 100% (2/2), 완료.
오브젝트 쓰는 중: 100% (3/3), 278 bytes | 278.00 KiB/s, 완료.
Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
To https://github.com/jinozpersona/jinozpersona.github.io.git
 + 4deda54...1eba1e2 main -> main (forced update)
'main' 브랜치가 리모트의 'main' 브랜치를 ('origin'에서) 따라가도록 설정되었습니다.

 

git:(main) $ git status

현재 브랜치 main
브랜치가 'origin/main'에 맞게 업데이트된 상태입니다.

커밋할 사항 없음, 작업 폴더 깨끗함

 

 

github 확인 : https://github.com/jinozpersona/jinozpersona.github.io

 

jinozpersona.github.io 확인 : https://jinozpersona.github.io

 

 

 


github default branch가 master에서 main으로 변경되었다고 합니다.

github branch master -> main 설정

branch 탭을 클릭하면 master와 main 중 현재는 default를 main으로 사용 중 : 불필요한 main branch는 삭제

 

 

 

반응형
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/07   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
글 보관함