article thumbnail image
Published 2021. 8. 17. 15:11
반응형

1. github 회원 가입하기

github 공식 홈페이지에 회원가입을 해줍니다. (이미 가입되어 있으신 분은 로그인!)
회원 가입은 오른쪽 상단에 sign up을 누르시고 이메일 주소, 비밀번호를 입력해주시면 간편하게 가입이 가능합니다.


2. github Repositories 만들기

Repositories new

로그인 -> 왼쪽 상단에 Repositories 옆에 new를 눌러서 새로운 Repositories를 만들어 줍니다.
Repository name을 지정해주시고

Repositories new 2

공개하실 건지 비공개인지 체크해주시고 추가할 부분을 눌러주신 다음

create repository

create repository를 눌러서 만들어줍니다.

 


3. repository clone

clone repository

새롭게 생성된 repository 오른쪽 상단에 code를 클릭하시면 https라고 적혀있습니다. 그 부분을 복사(옆에 클립보드 복사 버튼을 누르셔도 됩니다.) 

iterm2에서

git clone

cd 명령어를 이용해서 git이 설치되어 있는 폴더로 이동해서

git clone '복사한 https"를 입력해 줍니다.

저는 projects라는 이름으로 만들어서 cloning into 'projects'라고 적혀 있습니다. 


4. github push 1

이제 연결된 repository인 projects로 cd명령어를 사용해서 이동해줍니다.

echo hello world >> a.txt // 테스트를 위해서 hello world 라는 값을 가지고 있는 a.txt 파일을 생성
git add a.txt // add 명령어를 사용해서 추가해줍니다.
git state // 줄여서 st라고 입력하고 있습니다. 상태를 확인해보고
git push // 이제 github에 push 명령어로 remote로 보냅니다.

a.txt 파일을 git add

 

 git push를 입력하고 username, password를 입력하시면 저렇게 에러가 뜹니다.

git push fatal


5. personal access tokens

다시 github로 돌아와서 오른쪽 상단에 프로필 로고 클릭 -> settings 클릭 

git settings
settings -> developer settings 클릭

 

settings 왼쪽 메뉴에서 중간쯤 developer settings라는 메뉴가 있습니다. 

personal access tokens

들어가 보시면 personal access tokens라는 메뉴가 있습니다.

personal access tokens - generate new token

generate new token을 클릭하셔서 token을 만들어줍니다.

new personal access token setup

note는 projects token이라고 지어주었습니다.

expiration은 no expiration으로 설정해주었습니다. 저는 공부용으로 사용하기 때문에 기간을 제한할 필요가 없으니까요.

체크박스는 어떤 기능을 사용하게 될지 모르니 모든 기능을 다 체크해주었습니다.

generate token

generate token을 누르셔서 token을 만들어줍니다.

Make sure to copy your personal access token now. You won’t be able to see it again!

Make sure to copy your personal access token now. You won’t be able to see it again!

다시는 볼 수 없으니 지금 개인 액세스 토큰을 복사하라는 문구입니다.


6. github push 2

자! 그럼 다시 git push를 해보겠습니다.

git push succes!

드디어 첫 git push가 완료되었습니다.

 

반응형

'programming > Git' 카테고리의 다른 글

[iTerm2 ] iTerm2 세팅하기!  (0) 2021.08.15
[Git] Git Setup  (0) 2021.08.07
복사했습니다!