gitlab push 하기

yeonsoo·2022년 7월 27일
0

ssh 설정

(해당 컴에서 처음 접속하는 경우)

$ ssh-keygen
# enter file in which~: 그냥 엔터 (~/.ssh/id_rsa 에 저장됨)
# 쭉 엔터

$ cat ~/.ssh/id_rsa.pub

이후 출력되는 글 처음(ssh-rsa)부터 끝까지 복사
gitlab 내 계정 > setting > SSH Keys 메뉴의 Key에 붙여넣기 해서 add key

프로젝트 푸시

프로젝트 폴더에 가서

git init

부터 하고,
gitlab에서 Menu > Projects > Create new project > Create blank project로 프로젝트 우선 생성하고, 프로젝트 주소 복사
그다음 프로젝트 폴더에서

git remote add origin [address]
git add *
git commit -am "main"
git branch -M main
git push -uf origin main

그럼 아이디랑 비번 치라고 나오는데 치면 끝
git config --global로 설정해놓으면 매번 칠 필요 없는거같은데 우선 귀찮아서 패스

README.md

사실 새 폴더 만들고 gitclone으로 gitlab의 새 프로젝트를 받아온 후 거기에 프로젝트 파일들 복사하는게 편할 수도 있음
나는 그냥 gedit README.md 만들어서 푸쉬했음

$ gedit README.md
# 아무거나 대충 치고 저장
$ git add README.md
$ git push -uf origin main

error

server certificate verification failed. CAfile: none CRLfile: none

git config --global http.sslVerify false

You are not allowed to force push code to a protected branch on this project.

GitLab Project > Settings > Repository > Protected Branches > Expand > Unprotected 클릭





profile
to be enterprising

0개의 댓글