10월 16일 수요일
AM 알고리즘 문제 풀이, 과제 lv3 도전
PM 과제 진행
intelij에서 git연동 중 초기 branch가 master로 설정되어 관련하여 이런저런 문제들이 발생
String.matches()
String.matches("정규표현식")을 통해 if에서 문자열에 숫자가 있는지 알 수 있었다.
이전에 git을 관련하여 이것저것 해본다고 했을때 아마 문제가 발생했을것 같다.
새로운 프로젝트 생성 - git repository 생성 - 프로젝트에서 git init - git remote update(원격 저장소 업데이트) - git add . - git commit -m "커밋 메세지" - git push
도중에 발생했던 오류들로는
warning: LF will be replaced by CRLF in bora.txt.
The file will have its original line endings in your working directory
운영체제마다 줄바꿈을 바라보는 문자열이 달라서 발생하는 오류라고 한다.Windows, DOS
git config --global core.autocrlf true
Linux, MAC
git config --global core.autocrlf input
error: pathspec 'refactoring' did not match any file(s) known to git
해당 에러는 로컬 저장소의 git과 리모트 저장소의 git 정보가 동기화 되지 않아서, 새로 만들어진 리모트 저장소 브랜치를 참조할 수 없기에 발생하는 에러다.git remote update git checkout 브랜치명
! [rejected] main -> main (fetch first)
로컬 저장소와 원격 저장소가 동기화되지 않아 발생하는 문제이다. 기존 데이터가 손실될 수 있기 때문에 push를 막은 것이다.git pull --rebase origin main #git pull --rebase [원격저장소별칭][브랜치] git push
관련 링크 :
https://dabo-dev.tistory.com/13
https://devcamus.tistory.com/8
https://realzzu.tistory.com/107