Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIL] main으로 브랜치 이름을 변경해서 git push 하기 #20

Open
yunyoung1819 opened this issue Dec 19, 2023 · 0 comments
Open
Assignees
Labels

Comments

@yunyoung1819
Copy link
Owner

Date

  • 2023.12.20

Title

  • 기존에 git에 push하면 master 브랜치로 push가 된다. 이를 main 으로 변경해서 push 하는 방법을 기록하였다.

Description

1) git init 
2) git add . 
3) git commit -m "Initial commit"
4) git remote add origin http://github.com/your-username/your-repository.git
5) git branch -M main
6) git push -u origin main
  1. Git 저장소를 초기화
  2. 프로젝트의 모든 파일을 스테이징 영역에 추가
  3. 변경 사항을 커밋
  4. Github 또는 사용하고 있는 Git 호스팅 서비스에서 새로운 저장소를 생성함. 저장소 URL을 복사.
    복사한 원격 저장소 URL을 사용하여 로컬 저장소와 연결
  5. main 브랜치로 설정
  6. 원격 저장소에 푸시

Reference

@yunyoung1819 yunyoung1819 self-assigned this Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant