민서네집

[eclipse] github 와 연동하기. 본문

Java

[eclipse] github 와 연동하기.

브라이언7 2013. 7. 28. 23:56

< 참고자료 >


http://umsh86.tistory.com/entry/git-github-spring-source-tools-%EC%97%B0%EB%8F%99%ED%95%98%EA%B8%B0


http://mudchobo.tistory.com/527


http://interwater.tistory.com/87


http://mobicon.tistory.com/163


http://blog.outsider.ne.kr/866


https://help.github.com/articles/deleting-a-repository


http://blog.naver.com/niee/130112170119


http://www.eclipse.org/forums/index.php?t=msg&goto=648905&S=9bcfa96ab726d744d41a19c7fb02d723#msg_648905


http://stackoverflow.com/questions/3601805/auth-failed-error-with-egit-and-github/7629938#7629938


Test 날짜: 2013.7.28


OS: Mac OS X 10.7.5


기본적으로 참고한 URL 은 다음과 같다.


https://help.github.com/articles/generating-ssh-keys


그런데 eclipse 의 EGit 플러그인과 github 를 연동하기 위해서는


Step 2: Generate a new SSH key


에서 passpharse 를 입력하지 말고, 그냥 enter 만 쳐야 한다.


Step 4: Test everything out 까지 하고 나서,


eclipse 에서 github 에 push 할 프로젝트를 마우스로 선택하고, 오른쪽 클릭,


Team > Remote > Push... 을 선택.


위 그림처럼 Protocol 을 ssh 로 선택해도 되고, 아니면 다음 그림처럼 처음에 Protocol을 아무 것도 선택하지 않아도 된다.

그리고, ssh 키를 만들때 passphrase 를 입력하지 않았기 때문에 Password 항목에 아무 것도 입력하지 않는다.


그리고 나서 바로 Next 버튼을 클릭한다.


다음 화면으로 에러 메시지 없이 정상적으로 넘어가면 성공한 것이다.


- 이클립스의 Preferences 페이지(ssh2로 검색)에서 ssh2 키를 만들 수도 있는데, 나는 gtihub 의 guide 대로 Terminal 창에서 명령어를 입력해서 ssh2 키를 만들었다.


github 와 접속하기 전에 반드시 이클립스를 restart 하자. restart 하지 않으면 Auth Error 를 만나게 될 것이다.

- 아마도 eclipse를 restart 를 해야지 만들어 놓은 ssh2 키를 eclipse 에서 인식하는 것 같다.


SSH 를 이용한 방법은 위와 같이 하면 되고, https Protocol 을 이용하면 접속하는게 더 쉽다.


ssh 키를 만들고, github 에 등록할 필요도 없이 User 항목에는 github 의 Username 을, Password 항목에는 github 의 Password 를 입력하면 된다.



https Protocol 로 접속하는 것은 쉽게 됐는데,  ssh 프로토콜로 접속하는데, Auth Error 가 나서 애를 먹었다.


http://www.habdas.org/push-upstream-with-egit-and-eclipse-indigo/


위 블로그의 글이 결정적인 도움이 되었다.


도움이 된 글을 발췌하자면...


Simple fix that skips the passphrase and uses only Eclipse

  1. Use ssh-keygen from Git Bash, or Eclipse, to generate an RSA key, but do so without setting a passphrase.
  2. Open and copy the public key from ~/.ssh/id_rsa.pub and add it to GitHub via the SSH Public Keys section in Account Settings.
  3. Restart Eclipse. (Note: Not doing this was tripping me up for a while.)
  4. Try the Push Upstream steps again from the EGit User Guide.

The obvious pitfall here is that a passphrase cannot be associated with the RSA key. If skipping the passphrase is out of the question the following solution may be a little more up your alley.


Comments