Quick Start
- git repo 생성 및 폴더 생성
- echo "# github-practice" >> README.md
- git init
- git add README.md
- git commit -m "first commit"
- git branch -M main
- git remote add origin [email protected]:moonhyun94/github-practice.git
- git push -u origin main
SSH
.ssh 폴더 안에 있는 id_rsa.pub을 등록하면 매번 번거롭게 로그인 하지 않아도 됨
Pull Request
-
pull request를 보내고자 하는 repo를 fork
-
fork 한 repo를 local에 clone (ex: upstream)
-
git remote -v 를 통해 잘되었는지 체크한 뒤 git fetch upstream
-
git checkout upstream/main(=branch-name) => upstream의 main branch로 변경
-
git branch -a 를 통해 현재 어떤 branch를 사용하고 있는지 체크 가능
-
나의 main branch로 돌아와 git merge upstream/main => 나의 fork repository와 original repository간 merge -
나의 repo에서 code 등을 수정하고 pull request를 보냄
-
나의 request가 confirm 되면 적용됨
Linux Commands
- cd (change directory)
- ls / ls -a : 현재 디렉토리 파일 list
- echo
- cat [file-name] : file안의 내용 출력
- rm [file-name] : remove file
- rm -rf [folder-name] : 폴더 강제 삭제
- pwd (print working directory) : 현재 디렉토리 출력
Vim
terminal에서 사용 가능한 editor
- vi file.txt : 파일을 생성 or 파일을 읽음
- i 로 insert mode
- :w 로 저장
- :q 로 exit