[Git] Local에서 작업하던 디렉토리에 Remote 디렉토리 파일 합치기
local에서는 frontend 디렉토리 내 파일을 처음부터 작업 중이고, remote에는 다른 local에서 생성한 backend 디렉토리가 위치하는 상황을 생각해보자. local 환경에 remote에서 작업한 내용을 불러와서 합치는 것을 실험한 결과를 기록하려 한다. (정석적인 방법으로 한 것인지는 모르겠다. 그냥 기록용이다… 😭)
repository의 루트 디렉토리로 이동한다.
git initgit remote add origin [url]git fetchgit pull origin maingit branch -a아직
-> origin/main이 나오지 않는다.git branch -m master maingit branch -amaster브랜치의 이름이main으로 바뀐다.git remote set-head origin -agit branch -a-> origin/main이 나온다.git checkout developgit checkout -b feat/[issue-num]git add .git commit -m [commit-message]git push -u origin feat/[issue-num]
This post is licensed under CC BY 4.0 by the author.