TIL 15 우분투 github 연결

chp9419·2021년 5월 20일
0
post-thumbnail

오만짓 다하다가 삽질해서 드디어 우분투에서 로컬 과 사이트 연동을 알았다...!!!

그전에 내가 이것을 하려고 했던 이유는 다음과 같다.

나와 같은 상황이라면 밑에 방법을 해보는 것을 추천한다.

우분투 터미널에서 계속해서

💥레퍼런스를 master에 푸시하는데 실패했습니다.💥

💥레퍼런스를 https://~~~ 푸시하는데 실패 했습니다.💥

이렇게 나오면 밑에 있는 것을 해보면해결 될것이라 본다!

❗git init 사용하기 위해서는 내가 만들고자하는 파일에 속해있는지 pwd로확인!!

그 다음

git init 명령어를 사용하여 빈 깃을 초기화 시켜줍니다.

로컬 과 사이트 연결을 위해서 sudo git remote add origin 연결하고자주소
여기서 다음줄에 비밀번호가 나오면 로그인 비밀번호를 입력하면 다음칸으로 넘어간다.

그다음

git remote -v 입력한다(이것을 하는 이유는 remote에origin이 잘 연결되었나 확인하는 것이다.)

그다음

추가해놓았던 파일을 git add . 명령어를 확인해보고 git status 하고 난뒤 git commit -m "메세지입력"

그다음

git push origin master (입력하고나면)

Username for 'https://github.com': 본인 아이디
Password for 'https://github.com': 비밀번호

그다음

*[new branch] master -> master 로 나오면 정상적으로 연결하고자하는 레포지토리에 저장이 된다.!!!

=======================================

(base) chp@chp-chp6000:~/team$ pwd
/home/chp/team
(base) chp@chp-chp6000:~/team$ git init
/home/chp/team/.git/ 안의 빈 깃 저장소를 다시 초기화했습니다

=========================================================
(base) chp@chp-chp6000:~/team$ sudo git remote add origin https://github.com/chp9419/teamre.git
[sudo] chp의 암호:
(base) chp@chp-chp6000:~/team$ git remote -v
origin https://github.com/----/teamre.git (fetch)
origin https://github.com/----/teamre.git (push)

커밋할 변경 사항:
(스테이지 해제하려면 "git rm --cached <파일>..."을 사용하십시오)
새 파일: pr

:~/team$ git commit -m "본인이 입력하고자 하는 이름"

=================================================================
[master (최상위-커밋) 46f9cfb] new file_0.01
1 file changed, 1 insertion(+)
create mode 100644 pr

==================================================================
(base) chp@chp-chp6000:~/team$ git push origin master
Username for 'https://github.com':
Password for 'https://github.com':

==================================================================
(base) chp@chp-chp6000:~/team$ git push origin master

==============================================================
Username for 'https://github.com':
Password for 'https://본인아이디나옴@github.com':
오브젝트 나열하는 중: 3, 완료.
오브젝트 개수 세는 중: 100% (3/3), 완료.
오브젝트 쓰는 중: 100% (3/3), 208 바이트 | 208.00 KiB/s, 완료.

[new branch] master -> master ( 이렇게 나오면 사이트에 잘 연결된다는 뜻이다)

profile
주어진 문제는 해결하고 공부하고 성장한다.

0개의 댓글