본문 바로가기

Front-end/node

step03. git / node npm 프로젝트 버전 관리

반응형

1. git 설치

https://git-scm.com/download/win

 

Git - Downloading Package

Download for Windows Click here to download the latest (2.39.2) 32-bit version of Git for Windows. This is the most recent maintained build. It was released 23 days ago, on 2023-02-14. Other Git for Windows downloads Standalone Installer 32-bit Git for Win

git-scm.com

 

2. cmd > 'git --version' 확인

3. 터미널 > git --version 으로 설치 확인

 

4. 'git init' > 버전관리를 선언하겠다는 명령

 

5. git hub와 연결 단계

  • git config --global core.autocrlf treu
  • git config --global user.name "xx"
  • git config --global user.email "xx@xx"
  • git config --global --list 로 입력 확인하기

6.  'git status' > 파일 확인

 

7. 'git add .' 버전관리할 파일 추적(넣기)

 

8. 다시 git siatus 로 확인하면 추가된 파일을 확인 할 수 있음 (버전관리 시작)

 

9. git commit -m '프로젝트 생성' > 커밋할 메세지 입력 하면 완료

 

10. git log 로 버전확인

 

11. git hub 에서 저장소 (repositories) 만들기

 

12.  만들어진 저장소 주소를 가지고 

  • git remote add origin xxx.git >> 저장소 지정
  • git push origin master >> 해당 저장소에 푸쉬

 

**버전관리 할 필요없는 파일이 있을 경우

  • .cache
  • dist
  • node_modules

>> 관리하지않아도 똑같이 설치하여 만들수 있음

 

*git에 푸시하기전에 필요하지않는 파일은 푸시하지 않겠다 선언하면 좋음

1. 새파일 > '.gitignore'

2. 버전관리 하지않는 파일 작성(폴더가 아니어도 가능)

 

반응형