github
의practice
레포지토리 소스 코드 복제 및 다운로드하는 명령어
$ git clone https://github.com/jbro321/practice.git
변경된 파일을
stage
상태로 만드는 명령어
practice.py
를 stage
한다.$ git add practice.py
Q.
Stage
란?
A. 수정 및 생성한 파일을 깃허브에 올리기 전 단계라고 보시면 됩니다. 이 파일들을 올릴거다하는확인
단계입니다.
practice
repository의 변경사항이 있는 파일을 모두 stage
상태로 만드는 명령어입니다. (add
뒤에 띄어쓰기
해야됩니다. 주의해주세요.)$ git add .
stage
한 파일들 전부를 unstage
하는 명령어입니다.$ git reset HEAD --
stage
한 practice.py
파일을 unstage
하는 명령어입니다.$ git reset HEAD practice.py
Stage
한 파일을github
에 올리기 직전 단계로push
되기 전 단계
1st commit
이라는 메세지로 commit
합니다. `git commit -m "1st commit"
커밋된 이력들을 github에 올리는 명령어
github
에 연결된 main
이라는 branch
로 commit
된 변경사항들을 업로드$ git push origin main
test branch
에 push
$ git push --set-upstream origin test
github에서 변경된 내용들을 가져오는 명령어
github
의 변경 내용을 현재 내 directory
로 가져오고(fetch)
병합(merge)
합니다.$ git pull
git remote
를 통해서 기존 폴더를github
에 연결하는 방법
$ git init
git
파일을 stage
합니다$ git add .
stage
한 파일을 1st commit
이라는 메세지로 commit
$ git commit -m "1st commit"
$ git remote add origin [github_url.git]
$ git push -u origin main
github
에 branch
현황을 보여줍니다.$ git branch
github
에 new_branch
이라는 이름으로 branch
를 만듭니다.$ git branch "new_branch"
new_branch
로 이동합니다.$ git checkout new_branch
main
에서 test
branch
로 복사$ git push origin main:test
감사합니다.