본문 바로가기
Developement

[Git] private repository에 개발중인 project push 하기

by hymndaniel 2023. 2. 9.

1. private repository를 github에서 생성

2. github > settings > SSH and GPG Keys > SSH keys 설정

등록되어있는 키 확인

ls -al ~/.ssh

 

키 복사

pbcopy < ~/.ssh/id_ed25519.pub

https://devocean.sk.com/blog/techBoardDetail.do?ID=163311 

 

GitHub SSH 접속 설정하기

 

devocean.sk.com

 

 

3. Terminal 에서 git 명령어 실행

git init > git add . > git commit -m "commit" > git branch -M main > git remote add origin git@github.com:username/reponame.git (*github repo code ssh에서 복사)  > git push -u origin main

https://2vup.com/git-first-commit/

 

Github에 처음 파일 올리기(Repository 생성 및 git push)

🤖 Github에 처음 가입했을 경우 처음 Github에 가입한 후 Repository를 만들면 비어있는 상태입니다. 이 Github 사이트 내 나의 Repository와 나의 컴퓨터, 즉 로컬을 이어주기 위해서는 아래와 같은 절차

2vup.com

 

*! [rejected] master -> master (non-fast-forward) 에러 발생하면

git init (다시 초기화) > git remote add origin git@github.com:username/reponame.git > git push origin +main 

https://somjang.tistory.com/entry/Git-rejected-master-master-non-fast-forward-%ED%95%B4%EA%B2%B0-%EB%B0%A9%EB%B2%95

 

[Git] ! [rejected] master -> master (non-fast-forward) 해결 방법

ubuntu@server:~/PythonHome/TestTA/api$ git push --set-upstream origin master Username for 'https://github.com': SOMJANG-42MARU Password for 'https://SOMJANG-42MARU@github.com': To https://github.com/SOMJANG-42MARU/MaruKeyword.git ! [rejected] master -> mas

somjang.tistory.com

 

728x90