Git workflow
-fork
-clone
-commit (status, diff, add)
-push
(-sync with upstream)
-pull requests
cd //project root folder//
git clone //project url//
cd //project folder//
npm install: get the all dependencies, environment needed for the repository
-> needed for npm test: debugging
git checkout – ./: A checkout is an operation that moves the HEAD ref pointer to a specified commit.
git status: check changes
ls -a: local machine 외에 변경 사항이 확인되는지
// lists all files including hidden files starting with ‘. ‘
💥 git add . => git status 시 여전히 modified file이 존재할 수 있음: 다른 폴더에 변경된 파일이 있을 때
-> git status로 항상 check하기!!
git commit -m “first commit”
gs: == git status, branch HEAD 확인할 것!
git log: commit log 확인
git remote -v: branch 확인
git push: push everything to the repo, up-to-date
💥 synchronization
git remote -v
git remote add upstream //original repo url – forked one//
git pull upstream master: upstream -> master branch로 if any change exists, pull
Q. override => version conflict =>
pull request로 merge 전 conflict 방지
Q. pull request, sync with upstream의 목적 =>
- sync with upstream: orinigal repo의 changes 확인
- pull request: 💥 MERGE와 구분! feedback, review의 목적
=> when git history gets merged, adds commit on the top and merge
=> pull request before merge minimizes unuseful conflicts -> check others’ codes
★ Merge: add changes of ver2. to ver1.
git commit //file1// //file2// : individually commit 가능
REF
velog.io/@zansol/Pull-Request-%EC%9D%B4%ED%95%B4%ED%95%98%EA%B8%B0