no image
[Git] 오류: Updates were rejected because the tip of your current branch is behind
🎇 Git push error solution 새 프로젝트를 진행하려고 로컬에 repository를 생성한 뒤 github에 push 하려고 하자 아래와 같은 오류가 발생했다. 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 abou..
2023.05.02
no image
[Git] gitignore 작동/적용이 안될 때.
.gitignore가 제대로 작동되지 않아서 ignore처리된 파일이 자꾸 changes에 나올때가 있다....... (진짜 열심히 gitignore 설정했는데 안돼서 진짜 화났다....) git의 캐시가 문제가 되는거라 아래 명령어로 캐시 내용을 전부 삭제후 다시 add All해서 커밋하시면 된다. git rm -r --cached . git add . git commit -m "fixed untracked files" git 캐시를 삭제하니 바로 적용됐다. 그래도 나름 git 폴더가 깔끔하게 보여서 다행이다... 참고: https://stackoverflow.com/questions/11451535/gitignore-is-ignored-by-git .gitignore is ignored by Git ..
2023.03.25
no image
[Git] github에 100MB이상 파일 PUSH하기
50MB에서는 Warning을 표시하고, 100MB에서는 Error를 발생한다. * Warning의 경우 > remote: warning: Large files detected. > remote: warning: File big_file is 55.00 MB; this is larger than GitHub's recommended maximum file size of 50 MB * Error의 경우 > remote: warning: Large files detected. > remote: error: File giant_file is 123.00 MB; this exceeds GitHub's file size limit of 100 MB github 내용' Conditions for large file..
2023.02.28
no image
[Git] ![remote rejected] main -> main (pre-receive hook declined) 에러
에러가 발생 검색해보니 강제 푸쉬하라고 해서 했다... 그리고 버퍼 크기 늘려주라고 해서 늘려줬지만 또 경고창이 뜬다.... * 참고: 강제 푸쉬 명령어들 git push -f origin git push origin master -f git push -u origin master 여기서의 문제가 아마 내가 사용하는 브랜치가 main 이라서 그런듯 싶다. 그래서 사용한 명령어가 ! merge! 👉 해결 순서 1. git merge 2. git checkout master 로 브랜치를 master로 위치하게 하기 3. git merge 4. git log 로 확인하기 아래와 같이 HEAD -> master 로 가리키는 것을 알 수 있다. 5. git push 는 필요없는 것 같다. 해보니까 Everythi..
2023.02.28
no image
[Git] Please enter a commit message to explain why this merge is necessary, especially if it merges an updated upstream into a topic branch 에러메세지 해결
에러메세지 " Please enter a commit message to explain why this merge is necessary, especially if it merges an updated upstream into a topic branch " 해결 방안 1. 1. i 입력 2. merge에 대한 commit 메세지 입력 3. esc 입력 4. :wq 입력 5. enter 입력 끝 !! 해결 방안 2. 1.오류 창을 닫는다 2. git push를 한다. 끝! 참고: https://stackoverflow.com/questions/19085807/please-enter-a-commit-message-to-explain-why-this-merge-is-necessary-especially
2023.02.27
[Git] Git 캐시 삭제하기
캐시 삭제를 하지 않을 경우 gitignore가 적용이 되지 않을 수 있다. (애써 만든 gitignore 적용시켜야지ㅠㅜㅠㅠㅠㅠㅠ) gitignore가 작동되지 않을때 대처법 -> git 캐시 삭제하기 💡 .gitignore가 작동되지 않을때 대처법 $ git rm -r --cached . $ git add . // 당연히 git commit과 git push를 진행해야한다. git에 올릴 때는 개인 정보, 서버, DB, id, pw 포함 될 수 있으니 조심! 만약 캐시를 삭제했는데 모든 파일이 안보일 수 있다. 그럴 때 당황하지 말고 gitignore를 살펴봐야한다. 아마. gitignore 설정을 잘못했으리라...
2023.02.22
no image
[Git] Gitignore 특정 파일 숨기기
import How can i include only specific folders in git using .gitignore?[StackOverflow] Git Document 특정 파일 포함 .gitignore를 사용하면 Git을 통해 형상관리를 할 때, 포함시키지 않을 파일이나 폴더들을 설정할 수 있다. 이번에는 node_module 관련 특정 core script 파일을 수정할 일이 생겼는데, 해당 사항을 형상관리로 관리하고 싶어 기존에 ignore 하고 있던 목록 중에 특정 파일은 포함시키려는 상황이었다. .gitignore 파일내에는 다음과 같은 항목들을 가리키는 이름이나 경로가 포함될 수 있다: 임시 리소스들 예: 캐시 파일, 로그 파일, 컴파일된 코드 등. 다른 개발자들과 공유할 필요 없는..
2023.02.22
[Git] Git add commit 한꺼번에 날리기 + add commit push 날리기
1. git add commit 한꺼번에 날리기 $ git commit -am '커밋메시지 2. add+commit+push 날리기 일단 별칭을 정해야한다. git-scm 참조 링크 커맨드라인에서 아래의 코드를 작성합니다. git config --global alias.cmp '!f() { git add -A && git commit -m "$@" && git push; }; f' alias 에 cmp 라는 명령을 등록하여 사용할수 있다. Usage git cmp "커밋 메시지"
2023.02.22
no image
[Git] Git 특정 파일 추적 제거
요약 1.git update-index --assume-unchanged [filename (with path)] 원격저장소(서버)에는 파일이 있고 로컬에도 파일이 있지만 로컬에서의 변동 추적을 중지하고 싶은 경우 2.git rm --cached [filename] 로컬에 있는 특정 파일의 변동 추적을 중지하고 싶은 경우 만약 원격저장소에 파일이 있다면 원격 저장소에서의 파일은 삭제한다. 3.git rm [filename] 로컬에 있는 특정 파일의 변동 추적을 중지하고 더 나아가 아예 삭제하고 싶은 경우 만약 원격저장소에 파일이 있다면 원격 저장소에서의 파일은 삭제한다. 파일을 수정하다보면 특정파일은 트래킹 하기 싫을 때가 있다. 가령 credential파일들(설정파일)은 트래킹하면 끝도 없다. 아이디나..
2023.02.22