반응형

fatal: No configured push destination.

error message

$ git push
fatal: No configured push destination.
Either specify the URL from the command-line or configure a remote repository using

    git remote add <name> <url>

and then push using the remote name

    git push <name>

현재 위치의 폴더가 깃허브의 원격 레포지토리랑 연결이 안되있다는 뜻이다.
깃허브에 있는 자신의 리모트 레포지토리 원격 저장소(origin)와 연동을 해야한다.

command

git remote add <name> <url>
=> git remote add origin <원격 레포지토리 저장소 url>

정상적으로 깃허브 원격 저장소에 push 확인.
git push --set-upstream origin main
명령어를 해주면 정상적으로 깃허브 원격 저장소에 push된 것을 볼 수 있다

덤.

git init
-> 현재 로컬 폴더를 깃 로컬저장소로 만들어주는 명령어

반응형
반응형

GIT clone SSL Certificate problem

problem text

SSL certificate problem: unable to get local issuer certificate

command

git config --global http.sslVerify false
반응형
반응형

GIT PUSH ERROR

 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'https://github.com/xxx'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

result

-> git push origin +master
기존 데이터의 손실을 막기 위해 푸시를 막음.

반응형
반응형

Git Clone unrelated histories error

error message

From https://github.com/[repo name]
 * branch            master     -> FETCH_HEAD
fatal: refusing to merge unrelated histories

doing

  • 신규로 만든 프로젝트와 기존에 있는 프로젝트는 공통 적으로 같은 조상을 보고 있지 않아서 서로 다른 프로젝트라고 인식 함.
  • 따라서 독립적인 두 프로젝트를 병합하기 위해 아래의 command 사용
    git pull origin [branch name] --allow-unrelated-histories
반응형
반응형

깃 용어 설명

Origin :

 원격 저장소의 경로이름입니다. 

master :

 가장 중심이 되는 기본적인 branch를 master 브랜치

HEAD :

 현재 내가 어떤 작업공간에 있는지를 나타냅니다. 
 예를 들어 만약 제가 master 브랜치에서 작업을 하고 있다면
 제 HEAD는 master 브랜치에 있게 되는 것
반응형
반응형
  • 사용자 메일 / 이름 설정 
git config --global user.name <USER NAME>
git config --global user.email <USER EMAIL>
  • git commit시 불필요한 파일을 자동으로 제외할 때 ( .gitingnore 파일 수정 ) 
echo <file name> >> .gitignore

gitignore 코드/ 프로젝트 별 모아 놓은 사이트 

https://github.com/github/gitignore

 

GitHub - github/gitignore: A collection of useful .gitignore templates

A collection of useful .gitignore templates. Contribute to github/gitignore development by creating an account on GitHub.

github.com

  • 빈 폴더를 관리대상에 넣고 싶을 때
cd <filename>
touch .gitkeep
  • git config 설정 목록 확인
git config --global --list

<계속 추가할 예정>

 

반응형

+ Recent posts