2022년 9월 4일 일요일

git 사용법

처음

1. github에 들어가서 New로 새로운 repository(이름을 Processor라고 하자)를
만듬 (생성후 나오는 명령셋 참조)
2. 적당한 위치에 폴더를 만들고, vscode로 이 폴더를 오픈함
3. 폴더에서 필요한 프로그램을 작성
4. vscode의 New Terminal로 터미날을 오픈

5. 아래의 명령을 차례로 입력 (처음 업로드)
git config user.email "djk*****@d***.net"
git config user.name "djk*****"
git init (".git" 라는 폴더가 생기고현재 폴더의 변화를 추적하기 시작함)
git add filename (or git add .): 전체를 업로드하거나 변화된 파일만
업로드를 위해 파일을 staging함
git commit -m "First upload"
git remote add origin "https://github.com/galmegy/Processor.git"
(github repository와 연결)
git status: staging 상태 확인
git push -u origin master: 업로드 실행


재 수정

파일 수정 후 업로드를 원하면
git add ...부터 끝까지만 반복하면 됨


새로운 Branch

git branch Detector
git switch Detector
git status (Detector branch에 와 있음을 알 수 있음)