개요

GitHub는 Git 기반의 코드 호스팅·협업 플랫폼. 2008년 설립, 2018년 Microsoft 인수. 전 세계 1억+ 개발자가 사용하는 사실상의 소프트웨어 개발 표준 플랫폼.

  • 공식 사이트: https://github.com
  • 개발: GitHub Inc. (Microsoft 자회사)
  • 요금제: Free / Pro / Team / Enterprise

핵심 기능

기능설명
RepositoryGit 저장소 호스팅
Pull Request코드 리뷰·병합 워크플로우
Issues버그 추적·작업 관리
ActionsCI/CD 자동화
Projects칸반·스프린트 관리
Discussions커뮤니티 포럼
Packages패키지 레지스트리
Codespaces클라우드 개발 환경
CopilotAI 코드 자동완성

Git + GitHub 기본 워크플로우

# 저장소 클론
git clone https://github.com/user/repo.git
 
# 브랜치 생성
git checkout -b feature/new-feature
 
# 변경 후 커밋
git add .
git commit -m "feat: add new feature"
 
# 원격에 푸시
git push origin feature/new-feature
 
# PR 생성 (gh CLI)
gh pr create --title "새 기능 추가" --body "설명"

GitHub Actions (CI/CD)

# .github/workflows/ci.yml
name: CI
 
on:
  push:
    branches: [main]
  pull_request:
    branches: [main]
 
jobs:
  test:
    runs-on: ubuntu-latest
 
    steps:
      - uses: actions/checkout@v4
 
      - name: Python 설정
        uses: actions/setup-python@v5
        with:
          python-version: "3.12"
 
      - name: 의존성 설치
        run: pip install -r requirements.txt
 
      - name: 테스트 실행
        run: pytest
 
  deploy:
    needs: test
    runs-on: ubuntu-latest
    if: github.ref == 'refs/heads/main'
 
    steps:
      - name: 배포
        run: echo "배포 실행"

gh CLI 주요 명령어

# 설치
brew install gh   # macOS
# 또는 https://cli.github.com
 
# 인증
gh auth login
 
# PR 관련
gh pr create                    # PR 생성
gh pr list                      # PR 목록
gh pr checkout 123              # PR 브랜치 체크아웃
gh pr merge 123                 # PR 병합
 
# 이슈 관련
gh issue create --title "버그" --body "내용"
gh issue list
gh issue close 42
 
# 저장소
gh repo create my-repo --public
gh repo clone user/repo
gh repo view --web

브랜치 전략

전략설명
GitHub Flowmain + feature 브랜치, 간단
Git Flowmain/develop/feature/release/hotfix
Trunk-based단일 main, 짧은 feature 브랜치

보안 기능

  • Dependabot: 의존성 취약점 자동 PR
  • Secret Scanning: 코드에 포함된 시크릿 탐지
  • Code Scanning: 코드 보안 취약점 분석 (CodeQL)
  • Branch Protection: main 브랜치 직접 푸시 방지

관련 항목