🔗 아이콘
https://simpleicons.org/
🔗 배지 활용
https://shields.io/
🔗 markdown 미리보기
https://dillinger.io/
git과 github 연동 config (Git Bash 이용)
-> history 생성 add - commit
-> history 보낼 github repository 설정 remote
-> 전송 push
add -> commit -> push
github 회원가입
Git Bash 다운로드
git config
git config --global user.name "name" #주로 github name
git config --global user.email "email" #github 등록 이메일
git config --list
🔅 git config --list 종료는 Q
github에서 새로운 repository 생성
VSCode에서 예시 코드 작성 후 terminal-> New terminal
terminal에서 git 명령어 작성
git init
💡 맨 처음에만 작성하는 명령어
프로젝트 올릴 때 git init으로 git을 쓸 준비, 즉 초기화한다.
git add
📌 git add(space). 또는 git add (파일명)
.은 프로젝트 내에 존재하는 파일 전체를 의미. git add는 어떤 파일을 git에 올릴지 찾아본다. 전자를 이용해 프로젝트 내의 모든 파일을 올릴 수 있고, 후자를 이용해 파일 하나만 올릴 수도 있다.
git status
상태를 알려주는 명령어로 필수 아님
add되었을 경우 녹색으로 나타남
git commit
📌 git commit -m "first commit"
git commit은 history 만드는 것을 의미하며 -m 뒤에 history명 작성
first commit은 최종이라는 의미로, 최종, 최종_수정, 진짜 최종 등 history를 보여주는 역할
git remote
📌 git remote add origin (HTTPS 또는 SSH 주소 복붙)
🔅 추가: git remote add origin (HTTPS 또는 SSH 주소 복붙)
🔅 수정: git remote set-url origin (HTTPS 또는 SSH주소 복붙)
🔅 삭제: git remote remove origin
💡 add는 처음 로컬 프로젝트와 깃허브 사이 연결할 때에만 사용
❓ 전자와 같이 작성하였을 때 오류 발생
ssh: connect to host gmail.com port 22: Network is unreachable
fatal: Could not read from remote repository.
🔅 SSH key를 생성하지 않았는데 SSH 주소를 넣었음
두번째 코드 작성해 저장소 주소 수정
git remote -v
로컬 프로젝트와 깃허브 사이의 연결을 확인하는 명령어로 필수 아님
git push
📌 git push origin master
master branch로 파일 전송