VCS(버전관리 시스템) : 좀 더 정확하게는 분산형 버전관리
git add 파일명
git commit -m 메세지
커밋을 해주면 head는 main에서 분리된 상태로 커밋을 하는 족족 나아간다.
이때 checkout으로 main으로 돌아가면 그동안에 커밋 된 파일들은 날아간다. (가비지 콜렉터)
이를 방지하려면 새로운 branch를 만들어서 이를 참조하게 한다.
임시 생성된 branch는 나중에 없애면 된다.
충돌 상황
충돌된 파일 수정
다시 add하고 commit
위 사이트에서 원하는 gitignore을 설정할 수 있다.
일반적으로 폴더는 커밋이 불가능하다.
.gitkeep
SourceTree에서 초기 설정을 해주는 기능이 있음
체계적으로 기능들을 세분화해서 나눈 전략. 역할에 따라 브랜치를 나눔
branch 구분
master : 제품
hotfixes : 버그수정
release : 출시 후보(QA, 코드리뷰, 피드)
develop : 다음 버전을 위해서 개발, 다음버전, 개발중...
features : 기능 개발
CI : Continuous Integration
CD : Continuous Deploy
poolc-cicd/.github/workflows/node.js.yml
Heroku + Github Action 실습
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Node.js CI
# 발동 조건
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
# 작업 환경
jobs:
build:
# 우분투에서 돌아감
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x, 14.x, 16.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
# 동작 과정
steps:
- uses: actions/checkout@v2 # 두 개의 플러그인을 사용함
- name: Use Node.js ${{ matrix.node-version }} # 확장기능 사용
uses: actions/setup-node@v2
with: # for each와 동일
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run build --if-present
- run: npm test