카테고리 없음

git HUB

dddzr 2022. 6. 21. 21:36

git

소스 코드 관리 툴

git hub

클라우드 서비스. git으로 관리하고 있는 코드를 git hub에 올리고 다른 사람들과 공유, 수정

 

1. github에 가입하고 repository 생성

https://github.com/

 

GitHub: Where the world builds software

GitHub is where over 83 million developers shape the future of software, together. Contribute to the open source community, manage your Git repositories, review code like a pro, track bugs and feat...

github.com

 

github에 가입하고 repository 생성

 

2. SSH(Secure Shell)

로컬과 GitHub서버가 안전하게 통신하는 방법

 

0. 설치확인

id_rsa 또는 id_ed25519있으면 설치 된것

id_rsa는 private key

id_rsa.pub는 publick key

 

https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent

 

Generating a new SSH key and adding it to the ssh-agent - GitHub Docs

About SSH key generation If you don't already have an SSH key, you must generate a new SSH key to use for authentication. If you're unsure whether you already have an SSH key, you can check for existing keys. For more information, see "Checking for existin

docs.github.com

1. Key생성

$ ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

 

2. SSH agent를 backgrond에서 start

cmd나 power Shell에서는 x

git bash 이용함.

# start the ssh-agent in the background
$ eval "$(ssh-agent -s)"
> Agent pid 59566

3. private key 추가

$ ssh-add ~/.ssh/id_rsa

 

4. public key 추가

$ clip < ~/.ssh/id_rsa.pub

클립보드에 키 복사됨

git > 오른쪽 위 프로필에서 setting > SSH에 new key추가

 

5. repository에 있는 내용 복사, git hub연결

git init 이미해서 2번째 커맨드부터 복붙함