배워서? 남줘라!

[Github] #4 Local to Remote repository (Push & Pull) 본문

Github

[Github] #4 Local to Remote repository (Push & Pull)

developing 2022. 7. 13. 16:09

 

 

Git(Local repository)에서의 기본 branch: “master”

Remote repository의 기본 branch: “origin“

Local repository → Remote repository: “push”

Remote repository → Local repository: “pull”

 

 

Git commands Explanation
git remote add origin copied link Local repositoryremote repository 연결
copied link는 자신의 github 계정에서 새 repository 생성하고 HTTPS 링크 복사 ex. https://github.com/kyeonglim/test1.git
git remote –v Local repositoryremote repository 연결 확인
git push –u origin master origin branch (Local repository)master branch (Remote repository)push (–u는 처음에만)
git push 위처럼 연결하고 한번이라도 push 했으면 다시 push할 때에는 간략히 입력
git pull origin master Remote repository 내용을 Local repository로 가져옴
(git pull만 입력 가능)

'Github' 카테고리의 다른 글

[Github] #6 Colab to github  (0) 2022.07.13
[Github] #5 VS Code to github  (0) 2022.07.13
[Github] #3 Basic ‘Git’ commands  (0) 2022.07.13
[Github] #2 Basic ‘Linux’ commands  (0) 2022.07.13
[Github] #1 Let’s ‘Git’!  (0) 2022.07.13
Comments