[git] 새로운 프로젝트 올리기

최승언·2023년 1월 8일
0

git

목록 보기
14/27

로컬에서 작업한 코드를 깃서버 프로젝트에 올리는 방법.
우선 본인의 깃서버에 들어가서 프로젝트를 생성하고 url을 따자.

git init
git add .
git commit -m "<커밋메세지>"
git branch -M <branch 이름> //거의 main을 많이쓴다.
git remote add <remote 이름> <저장소 url> //remote 이름은 주로 origin을 사용한다.
git pull <remote 이름> <branch 이름> --allow-unrelated-histories
git push -u <remote 이름> <branch 이름>
profile
작업하다가 막힌부분을 기록하는 곳.

0개의 댓글