Skip to content

Latest commit

 

History

History
51 lines (35 loc) · 749 Bytes

File metadata and controls

51 lines (35 loc) · 749 Bytes

Git Init

git init은 현재 폴더를 Git 저장소로 만들 때 사용한다.


1. Git 저장소 초기화

현재 폴더를 Git repository로 만든다.

git init

example

git init
Initialized empty Git repository in /home/user/project/.git/

2. 기본 branch 이름 지정

초기화 후 기본 branch 이름을 main으로 맞춘다.

git branch -M main

3. 저장소 초기화 후 첫 업로드 흐름

git init
git add .
git commit -m "INIT: first commit"
git branch -M main
git remote add origin <repository URL>
git push -u origin main

4. 자주 쓰는 방식

git init
git branch -M main