>

상세 컨텐츠

본문 제목

[플러터] 자주 사용하는 git 명령어

7. 봉드로이드_개발공부

by 마켓플레이어, 마케터 봉 2025. 10. 15. 12:22

본문

처음 깃 올릴 때

  1. 깃 저장소 초기화
  2. git init
  3. 깃허브에서 생성한 저장소 연결
  4. git remote add origin https://github.com/깃허브아이디/저장소명.git
  5. 제대로 깃허브와 연결되었는지 확인(원격저장소 생성)
  6. git remote -v
  7. 깃에 파일 올리기
# Flutter/Dart
.dart_tool/
.packages
build/
.pub-cache/

# iOS/Xcode
ios/DerivedData*/
ios/**/Build*/
ios/**/BuildProductsPath/
ios/**/Index.noindex/
**/*.dSYM/
**/*.xcindex/
*.mdb

# Flutter iOS
ios/Flutter/
ios/.symlinks/
ios/Pods/

# Android build
android/**/build/
git add .
  1. 변경내용 기록하기
  2. git commit -m "기록할 아무 내용 작성"
  3. github에 업로드하기
  4. git push -u origin main
  5. dev 브랜치 생성하고 이동하기
  6. git checkout -b dev

git 이력 완전 초기화

rm -rf .git

깃헙 저장소 수정할 때

  1. 수정된 파일 확인 (안해도 됨)
  2. git status
  3. Git에 파일 추가(스테이징) - 보통은 git add . 으로 퉁침
  4. git add 파일명 git add test.dart // 해당 파일만 추가 git add . // 전체 추가
  5. 변경사항 커밋하기
  6. git commit -m "코멘트"
  7. GitHub에 업로드(PUSH) - main 브랜치 대신 dev 브랜치로 하는 게 안전함
  8. git push origin main

모든 브랜치 목록 확인하기

git branch -a

특정 브랜치로 이동하기

git checkout dev
반응형

관련글 더보기