node.js 백엔드 맛보기 강의 영상 정리9.
1. git bash에서 .code로 visual studio를 켜준다.
이를 통해 우리는 vscode 터미널에서 우분투 명령어를 사용할 수 있다.
2. 디렉토리를 확인하고 git.init을 해준다.
ls명령어로는 .git 파일이 제대로 생겼는지 볼 수 없다 ls -a을 해주어야 한다.
3. nano README.md
4. nano .gitignore
깃허브에 업로드되면 안되는 파일들을 저장해놓음
/node_modules 를 제외하고 업로드
5. git status
gitignore가 잘 적용되었으면 untracked file에 /node_modules가 없다.
6. git add
.git이라는 폴더 안에 변경내역을 저장하게 됨
The file will have its original line endings in your working directory 경고 메시지
별 문제는 안됨
https://datadokdok.tistory.com/5
7. git remote -v
원격 저장소 없음 확인
8. git remote add origin https://github.com/oculo0204/login-lecture
9. git pull origin master 후 git push origin master
error: src refspec master does not match any
원인 : github에서 pull없이 push할 경우 기존 내용 삭제 문제가 생길 수 있기 때문에 발생한다.
git init
git add .
git commit -m "message"
해주고 다시 git push origin master 해주면 된다.
10. 다운 받기
11. 터미널에서 상위 폴더에 clone하기 git clone https://github.com/oculo0204/login-lecture login-lecture2
12. 터미널에서 npm i 혹은 npm install 입력
13. 최종 파일 src안에 집어넣기
14. license 는 업데이트 된듯 다시찾아봐ㅇ
15. git 업로드 실수하면?