bash셀에서 ssh-add ~/.ssh/id_rsa 입력 

그런데 Could not open a connection to your authentication agent. 요런 에러가 나타나면 
eval $(ssh-agent) 입력해주면 끝 

'Git' 카테고리의 다른 글

git 사용법  (0) 2021.06.07

기존에 local에서 작업중인 프로젝트를 git repository에 연결해서 push 하는 방법 

gitlab 에 repository를 생성했다고 가정하에 시작한다.

1. git bash 실행

2.  작업중인 개발 directory로 이동 

3. git init 실행 -> .git 폴더가 생성된다. 

4. git config --global user.email "내 이메일", git config --global user.name "내 이름" 명령어를 쳐서 자기 정보를 등록

5. remote를 등록 해줘야만 pull, push, fetch...등이 가능 하다 (  삭제 명령어 : git remote remove <remote name>

  -git remote add origin https://gitlab.com/{project이름}.git 

  : origin이라는 이름으로 remote가 등록되며 차후, push, pull.. 할때 원격 주소를 모두 타이핑 할 필요 없이  origin 이라는 alias으로 대체 가능

 

Iterate faster, innovate together

Our open DevOps platform is a single application for unparalleled collaboration, visibility, and development velocity.

about.gitlab.com

6. git remote  실행하여 remote가 정상적으로 등록되었는지 확인 한다. 

   - 정상적으로 등록되었다면 origin이라고 리스트가 뜸 

7. git pull origin <branch name>  으로 pull받을수 있다 !!

  - pull받을때   refusing to merge unrelated histories   Error가 발생할 경우

    git pull origin branch_name --allow-unrelated-histories 사용하면 해결 된다. 

 

Enter passphrase for key '~/.ssh/id_rsa':

아오 할 때 마다 ssh 키에 대한 암호를 입력하라니 여간 귀찮은 일이 아니다. 이대로 이 문제를 방치할 수는 없어서 해결방법을 찾아보았다.

문제는 ssh-agent가 이 키를 저장하고 있지 않아서 매번 물어보는 문제였다. 해결 방법은 아래의 커맨드다.

 ssh-add ~/.ssh/id_rsa

그런데 또 이런 문제가 발생하는 것이 아닌가!?

Could not open a connection to your authentication agent.

이 문제는 또 무엇일까? ssh-agent가 동작을 하고 있지 않다는 것이다. 이 문제는 아래의 커맨드로 해결 가능하다.

eval $(ssh-agent)

앞서 언급했듯 위의 커맨드도 Git Bash에서 입력했다.



출처: https://gentlesark.tistory.com/86 [삵 izz well]

 

'Git' 카테고리의 다른 글

git push 할때 ssh 비번 계속 물을때 해결법  (0) 2021.06.09

+ Recent posts