WEB 만들기 5 - git허브 연결
본문 바로가기
WEB

WEB 만들기 5 - git허브 연결

by KyeongMin 2021. 1. 16.
728x90
반응형

git 은 도구 

git hub 깃을 사용 하는 서비스 

 

github 사이트에서 회원가입을 하고 나서  

github.com/

 

GitHub: Where the world builds software

GitHub is where over 56 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

 

이런 화면이 나오게 됩니다. 

new 버튼을 눌러서 Repository name 부분에 원하는 이름 써서  생성을 합니다. 

 

이제 우리가 안전하게 통신을 하기 위해서는 SSH 라는 Secure Shell 를  이용합니다. 

 

일단 SSH가 설정이 되어 있을 수 있기 때문에 우선은 확인을 해야합니다. 

ls -a ~/.ssh

를 했는데 

 

이런게 있다면 있는것이다. 

 

docs.github.com/en/github/authenticating-to-github/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

Generating a new SSH key and adding it to the ssh-agent After you've checked for existing SSH keys, you can generate a new SSH key to use for authentication, then add it to the ssh-agent. Mac Windows Linux If you don't already have an SSH key, you must gen

docs.github.com

여기서 맞는 OS에 따라서 진행하면된다. 

ssh-keygen -t ed25519 -C "oksos0817@naver.com"

이메일은 각자의 이메일을 적으면된다. 깃을 생성했을 때 만든  이메일이다. 

이렇게 나오는데 일단 엔터를 계속친다. 

일허게 되고 

 

그리고 두번재는 SSH Agent를 화면에 켜야한다. 

eval `ssh-agent -s`

 

이것을 입력해줍니다.  그러면 안되는데 이게 기본 cmd나 이런창에 하면 에러가 생기기때문에

git bash에 다시 이메일 입력해주고 오버라이디 할꺼냐 나오는데 yes 해주고 다시 진행하면 

이렇게 나오게된다. 

아까 이렇게 두개가 있었는데 하나는 프라이빗 키이고 하나는 퍼블릿 키 이여서 프라이빗 키를 add를 해줘야하는데 

ssh-add ~/.ssh/id_ed25519

이 명령어를 해주면 프라이빗키가 SSH agent에  ADD가 되는것이다. 

 

깃 허브랑 연결해야하는데 

 

docs.github.com/en/github/authenticating-to-github/adding-a-new-ssh-key-to-your-github-account

 

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

Adding a new SSH key to your GitHub account To configure your GitHub account to use your new (or existing) SSH key, you'll also need to add it to your GitHub account. Mac Windows Linux Before adding a new SSH key to your GitHub account, you should have: Af

docs.github.com

이사이트에서 천천히 따라서 진행하면된다. 

 

clip < ~/.ssh/id_ed25519.pub

이것을 먼저 입력을 해주고 이것은 현재 붙여넣기가 된것이다. 

 

깃헙에 settings 부분에 들어가서 

여기서SSH and GPG ketys 눌러서 

여기서new ssh key 눌러서

제목은 알아서 하고 아까 복사한것은 key에 넣는다 . 

이렇게 까지 하면 된다. 

만든 레포지터리의 입력을 따라하면된다. 

이것은 vs code 에서 진행하자. 

 

근데 우리가 그전에 위에꺼는 했기때문에

아래만 해주면된다. 

그럼 끝~!

 

이런게 복잡하다고 생각이 든다면 Source Tree 라는게 있는데 그것을 이용하면 더 간편합니다. 

 

728x90
반응형

댓글