
기존 리눅스 커널을 관리하는 툴이 맘에 들지 않아 2주만에 git이라는 시스템을 만들게 되었다고 한다.
대단쓰..👍🏻
git --version: git이 깔렸는지 확인git config --global user.name “____” 👉 사용자id등록git config --global user.email ___@____ 👉 사용자 이메일 등록git config --global core.editor “code ——wait” 👉 에디터설정git config --global core.autocrlf input 👉 맥에선git config --global core.editor "/Applications/Visual\ Studio\ Code.app/Contents/MacOS/Electron” 👉 Mac에서 오류가 생겼을땐 이 명령어를 사용! git config --list 👉 터미널에서 설정 정보 확인git config --global -e 👉 vsc에서 수정cmd+shift+p에서 code 실행 추가git config --global init.defaultBranch main 👉 master → main으로 만들어버리는 것git branch -m main 👉 기본 브랜치가 master일 때 main으로git config --global push.default current 👉 -u 할때 로컬브랜치명으로 레포 생성하도록!mkdir git-study 👉 디렉토리 생성echo “파일안내용” > hello.txt 👉 파일안내용이 포함된 hello.txt 생성echo “파일안내용2” >> hello.txt 👉 파일안내용2 추가cat hello.txt 👉 파일내용 확인git init 👉 git 초기화git rm -f hello.txt 👉 파일 지우기git add hello.txt 👉 staging area로 이동git commit -m “첫번째 커밋” 👉 staging area 파일을 커밋!git log 👉 커밋 history 확인 / 나올땐 키보드 ‘Q’git log ——oneline 👉 history를 한눈에 보여줌git remote add origin <repo주소> 👉 <주소>인 origin가상주소 생성git remote -v 👉 리모트 브랜치 조회git remote rm origin 👉 origin 삭제git push origin main 👉 main 브랜치로 보내기git clone "깃허브주소" 👉 깃 복사git pull 👉 깃허브에 있는걸 가져오는 것, 깃내용 복사onpx degit 주소 new폴더명 👉 노드복사, 깃내용 복사xgit init -b main 👉 저장소 초기화 시키면서 main으로git branch “브랜치명” 👉 생성git checkout -b “브랜치명” 👉 생성 + 해당 브랜치로 이동git switch “브랜치명” 👉 브랜치 변경git branch “브랜치명” -d 👉 삭제git reset ——hard 소스값 👉 소스값으로 보내고 그 이후꺼는 지운다.
git reset ——soft 소스값
👉 커밋 전으로 보내지만, 코드는 지우지 않는다 → 각각 따로 커밋했지만 합칠때 유용하다.