본문 바로가기

컴퓨터

git push하는 법

728x90
반응형

로컬 컴퓨터에 

git clone을 한 후 자신의 코드를 바꾼 후, git 저장소에 있는 코드를 수정하고 싶을 때가 있다.

 

이럴 때 하는 것이 git push이다.

 

순서는 아래와 같다.

git config --global user.name "Your Name Here" 
git config --global user.email "your_email@youremail.com"

git init
git add .
git commit -m '수정 내용을 적어준다. 따옴표는 반드시 넣어줘야함.'
git remote add origin https://~~~/github.com/~~~~.git
git push -u origin master

 

아래의 오류 발생시 해결법
# error: src refspec master does not match any

git checkout -b 'master'
git push origin master


이 후 성공하면 자신의 repository에 들어가서 수정내역을 확인한 후 commit과 merge버튼을 누르면 된다.

올바르게 push 될 때의 모습

728x90
반응형

'컴퓨터' 카테고리의 다른 글

illustrator CS2 다운로드 경로  (0) 2023.11.06
qsub에서 queue 지정하는 방법  (0) 2023.09.18
scp 명령어  (0) 2023.06.20
freebayes dockerfile  (0) 2023.02.21
docker에 원하는 경로 마운트 (mount)하기  (0) 2022.11.01