본문 바로가기

dev/git

(4)
vscode repository 연결 vscode에서 프로젝트 생성 후 깃허브 레포지토리와 연동하려고 한다. 프로젝트 폴더경로에서 .git 파일을 생성하기 위해 아래 명령어를 실행한다. git init 원격 레포지토리와 연동한다. git remote add origin 레포지토리 주소 깃의 기본 브랜치가 master로 되어있으므로 깃허브의 main과 동일하게 바꿔줘야한다. git branch -M main 아래 명령어를 통해 깃 자체의 기본 브랜치 설정을 변경해주어도 된다. git config --global init.defaultBranch main 깃허브로 푸쉬 해준다. git push -u origin main
git clone 후 git hub에 push 가 안됨 git hub 에서 repository 생성 후 vscode에 복제를 했다. 코드 작업 후 커밋을 했는데 푸쉬가 안되서 git status를 확인하니 이러한 오류가 생겼다. 친절히 적혀있는 명령어를 입력하고 다시 브랜치 게시를 하니 정상적으로 푸쉬가 된다. $ git branch --unset-upstream 로컬에 origin 이 없어서 생기는 오류인거 같다. Why call git branch --unset-upstream to fixup? I'm more of a novice when it comes to advanced operations in git. I maintain my blog using the blogging framework Octopress. Though Octopress is no..
깃 이슈 깃허브 풀을 했는데 에러가 났다. $ git pull hint: You have divergent branches and need to specify how to reconcile them. hint: You can do so by running one of the following commands sometime before hint: your next pull: hint: hint: git config pull.rebase false # merge hint: git config pull.rebase true # rebase hint: git config pull.ff only # fast-forward only hint: hint: You can replace "git config" with "git..
깃 다루기.. 코드를 깃허브에 올리면서 정확히 깃 사용법을 알고 있지 않다. 잘못된 커밋을 하고 푸시를 하는 등의 상황이 빈번하게 일어날 것이기에 공부를 해야겠다. 깃 상태 확인 git status 코드 수정 전 On branch main Your branch is up to date with 'origin/main'. nothing to commit, working tree clean 코드 수정 후 $ git status On branch main Your branch is up to date with 'origin/main'. Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git restore ..."..