- trevi_
- Korea
- isuu.jeong@gmail.com
- https://github.com/ijgit
[Git] Git 기초
1. git 최초 설정 사용자 정보 설정 git을 설치하고 가장 먼저 해야 하는 것은 사용자 이름/이메일 주소를 설정하는 것이며, 아래 명령어를 통해 설정 가능하다. $ git config --global user.name "USERNAME" $ git config --global user.email USER_EMAIL@example.com 편집기 설정 git 에서 사용할 텍스트 편집기 설정할 수 있다. git은 기본적으로 시스템의 기본 편집기를 사용하나 명령어를 통해 변경 가능하다. $ git config --global core.editor emacs 설정 확인 git config --list 모든 설정 값을 확인 git config 특정 key 에 대한 설정 값 확인 2. Git 저장소 만들기 gi..
[Git] Git branch 이름 변경하기
원격 브랜치 (Remote Branch) 이름 변경 git에서 원격 브랜치 이름 변경 방식 새로운 브랜치를 생성한 뒤에 이전 것을 삭제 순서 새로운 branch 이름으로 push 진행 이전 원격 branch를 삭제 remote branch 이름 변경 명령어 SRC 바꾸고자 하는 branch 이름 (이전 branch 이름) DEST 새로운 branch 이름 push 하려는 branch로 checkout (전환) $ git checkout DEST push 진행 $ git push origin -u DEST 해당 명령어를 실행한 뒤에 repository를 확인해보면 기존 branch가 그대로 존재하고, 새로운 branch가 생성된 것을 확인할 수 있음 이전 branch 삭제 $ git push origin ..
[Git Error] Remote origin already exists
문제 상황 git remote add origin 명령어 실행시 아래와 같은 오류 발생 $ git remote add origin https://github.com/.. fatal: remote origin already exists. 해결 방법 git remote add 대신 git remote set 명령어를 실행 $ git remote set-url origin https://github.com/.. 원인 저장소를 복제 clone 한 후에 자신의 원격 서버를 추가하려고 할 때 해당 오류가 발생 저장소를 복제했을 때 Remote origin 이 같이 복사됨 origin이 일반적인 규칙이므로 이미 origin이라는 이름으로 구성된 원격이 있을 가능성이 높음 summary repository를 clone..
[Git error] ![rejected] Note about fast-forwards
문제 상황 git push 명령어 실행시 아래와 같은 오류 발생 $ git push To https://github.com/... ! [rejected] develop -> develop (non-fast-forward) error: failed to push some refs to 'https://github.com/...' hint: Updates were rejected because the tip of your current branch is behind hint: its remote counterpart. Integrate the remote changes (e.g. hint: 'git pull ...') before pushing again. hint: See the 'Note about fa..
[Git error] fatal: 'origin' dose not appear to be a git repository
문제 상황 git push를 하던중에 오류가 발생하며 push 를 실패하였다. fatal: 'origin' does not appear to be a git repository fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. 해결 1. origin 이 설정되었는지 확인 ```shell $git remote -v ``` 해당 명령어를 실행하면 프로젝트의 모든 push/fetch remote 가 표시된다. 만약 출력이 없이 반환된다면, 아래 명령어로 누락된 remote 를 추가하고 push 를 진행하면 된다. (목차 4와 일치) ```..
[summary] Git command
내가 보려고 만드는 깃 커맨드 계속해서 업데이트 예정 저장소 (Repository) 설정 초기 설정 $ git clone REPOSITORY_URL $ git init $ git remote add origin REPOSITORY_URL $ cd REPOSITORY_NAME REPOSITORY_NAME/ $ git add . REPOSITORY_NAME/ $ git commit -m "commit something" REPOSITORY_NAME/ $ git push -u origin master 브랜치 (Branch) 브랜치 변경 (change branch) git checkout BRANCH_NAME 브랜치 이름 변경 (change branch name) 변경하고자 하는 branch name (이전 브..