카테고리 없음

프로젝트 시작 시 Git 연결 및 Pull,Push 기본적인 기능 순서

찹쌀뗙 2022. 11. 25. 15:00
반응형

1. GitHub - Repository에서 저장소 만들기

 

 

 

 

 

2. 로컬저장소와 Repository를 연결시켜야함

  • (1) Git clone "[깃주소]"
  • (2) 로컬저장소에 폴더를 만들어 Repository를 연결시키기
    • 로컬저장소 폴더 안에서 git init 을 해줌
    • git remote add origin [깃주소]

 

 

 

 

3. 첫번째 푸쉬해보기!(Git push)

  • git add .
  • git commit -m 'commit massage'
  • git push

 

 

 

4. (3)에서 오류가 났을경우

  • The file will have its original line endings in your working directory
    warning: LF will be replaced by CRLF -> 이 메시지가 뜨면
    "git config --global core.autocrlf true" 작성
  • fatal: The current branch master has no upstream branch.
    To push the current branch and set the remote as upstream, use
    -> "git push --set-upstream origin master" 첫 푸쉬에는 해당 명령어로 push 

 

 

 

5. 깃 저장소에서 파일 가져오기 (Git pull)

  • 로컬저장소 안에서 git pull

 

 

 

 

 

 

 

 

 

 

 

 

 

반응형