본문 바로가기
git 정리

[9] 유데미 git 강의 - Github의 기초(1) , git clone, ssh 구성

by 개도필 2022. 6. 18.

Github는 어떤 역할을 할까?

  • 깃 저장소를 위한 호스팅 플렛폼
    • 인터넷 ,계정으로 이용
  • 클라우드에 깃 저장소를 넣을 수 있다.
  • 협업하기 너무 좋다
    • 하나의 master에서 branch를 통해 협업이 가능~~

위에 귀요미가 깃허브

Git Clone으로 Github Repo 복제하기

→깃의 저장소를 내 빈 저장소에 복제

  • git clone
    • 우리의 컴퓨터에 없는 저장소를 여러분의 컴퓨터로 가져온다.
    • 입력한 url에 있는 소스 코드(저장소)들을 다 복제한다.
  • git hub의 코드가 아니라 git의 코드이다
  • 클론할 때 가장 먼저 해야 하는 일은, 저장소에 있지 않은지 확인해야한다.
git status 
  • 깃은 그 URL로 가서 저장소에서 관련 정보를 갖고 온다.
    • 우리들의 컴퓨터에서 새 저장소를 초기화한다.
    • 모든 코드 , 모든 커밋들을 갖게 된다.
git clone <url>
  • git 2048 repo clone해보기
    • 새로운 폴더가 생성된다

https://github.com/gabrielecirulli/2048

 

GitHub - gabrielecirulli/2048: A small clone of 1024 (https://play.google.com/store/apps/details?id=com.veewo.a1024)

A small clone of 1024 (https://play.google.com/store/apps/details?id=com.veewo.a1024) - GitHub - gabrielecirulli/2048: A small clone of 1024 (https://play.google.com/store/apps/details?id=com.veewo...

github.com

git clone <https://github.com/gabrielecirulli/2048>

 

 

git clone관련 질문

  • git clone은 github에서 저장소를 가시적으로 볼 수 있다면 걍 다 허용(open된 깃 저장소)
  • 하지만 git push는 허가필요

 

 

Github설정 : SSH 구성

  • 깃 remote 할때마다 귀찮게 비밀번호를 안쳐도 된다.

https://docs.github.com/en/authentication/connecting-to-github-with-ssh

  1. 깃허브에 들어가서 로그인
    • 깃허브에 연결된 이메일 확인하기
    • → 깃허브가 우리가 누군지 알게 된다.
git config user.email

 

  2. ssh키 설정하기

  • ssh키중 하나를 생성한 다음, 깃허브에 알려주면 된다.
  • ssh키 설정돼있나 확인
ls -al ~/.ssh

 

 

  • 튜토리얼에 따라서 ssh키만들기

https://docs.github.com/en/authentication/connecting-to-github-with-ssh

→ 튜토리얼 보고 따라하기

  • 키 생성
ssh-keygen -t ed25519 -C "your_email@example.com"
  • ssh키 저장될 파일 이름 만들기 (나는 그냥 엔터침)
  • 비밀번호 치기 (2번)

키 생성됨

 

 

  3. SSH키를 SSH에이전트에 추가

아래 방법을 따라하면 된다

  4. GitHub 계정에 새 SSH 키 추가

  • 아래 튜토리얼 따라하기

https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account

 

Adding a new SSH key to your GitHub account - GitHub Docs

Before adding a new SSH key to your account on GitHub.com, you should have: After adding a new SSH key to your account on GitHub.com, you can reconfigure any local repositories to use SSH. For more information, see "Switching remote URLs from HTTPS to SSH.

docs.github.com

 

 

 

댓글