IT/git16 GIT - pull, push, clone이 명령어로 안될 때 이슈 Intellij 이용하여 clone, push, pull 명령어가 작동하지만 command line에서 해당 명령어들이 작동 안할경우 해결하는 방법을 소개하고자 한다. 필자의 경우 git clone xxx, pull xxx 하면, 해당 repository를 찾을 수 없는 에러 메시지만 보여 답답했다. intellij에서는 명령어가 실행이 되는데... remote: Repository not found. fatal: repository 'https://xxx.xxx.git/' not found 해결방법 git config --edit --system helper = xxx 이 들어간 라인을 삭제 한다. 그리고 다시 해보면 된다. 2023. 6. 13. GIT - Tag 개념 특정한 커밋 버전을 따로 표기한다. 물론 commit id로 구분할 수 있지만 쉽게 기억하긴 쉽지 않다. 히스토리용으로 많이 사용한다. 명령어 태그 생성 git tag 1.0.0 master //branch 이름으로 해도 됨 git tag 1.0.0 ${commitId} //커밋id로 해도 됨 git tag -a 1.1.0 -m "bugfix" //주석을 추가하려 할 때 태그 정보 확인 git tag -v 1.1.0 local 태그를 remote 태그로 반영 git push --tags 태그 삭제 git tag -d 1.1.1 Reference https://www.youtube.com/watch?v=RttSK75yQks 2023. 6. 13. GIT - Status 개념 working directory 상태와, staging area의 상태를 보여줌 - 어떤 파일이 git에 의하여 버전관리를 하고 있는지 아닌지 - 어떤 파일이 git에서 커밋되어 있지 않은지 - 어떤 파일이 변경되었는지 원리 최신 Index 안의 내용과 마지막 커밋한 tree안의 내용과 비교 명령어 $ git status On branch master Your branch is up to date with 'origin/master'. Changes to be committed: (use "git restore --staged ..." to unstage) new file: a Changes not staged for commit: (use "git add ..." to update what wil.. 2023. 6. 13. GIT - Stash 개념 작업 중인 staged area에 있는 내용들을 다른곳에 보관해둔다. 언제 사용 하나요? 현 작업 중인 브렌치에서 아래의 명령어로 코드를 임시로 보관해야 할때 개발 중 급하게 다른 브렌치로 옮기고 개발해야할 때 개발 중이였던 코드를 버리기도 애매하고, 커밋하기도 애매할때 명령어 임시로 보관해야 할때 git stash 임시 저장된 코드를 복원하고 싶을 때 여러 stash가 있을때 최신의 것을 가져온다 git stash apply 여러 stash가 있고 예전 stash를 적용하고 싶을때 git stash list //확인하고 git stash drop //최신 stash 삭제하고 git stash apply //적용 git stash pop //apply + drop Reference https://w.. 2023. 6. 13. GIT - Reset 개념 예전 커밋 상태로 돌아가고 싶을 때 Command git reset {commitId} --hard 주의할 점 Remote Repository에 반영된 것들은 절대로 reset을 하면 안됨 Reference https://www.youtube.com/watch?v=eVo2lmkXaDc 2023. 6. 13. GIT - Prune 개념 unreachable git object 들을 local 에서 clean 하는 작업. - remote의 것을 지우는것이 아님 - unreachable 어떠한 ref에도 접근할 수 없는 것. git remote prune origin Reference https://www.atlassian.com/git/tutorials/git-prune Git Prune | Atlassian Git Tutorial It's time to clean up your codebase! Learn about Git Prune, a housekeeping utility that cleans up unreachable or "orphaned" Git objects. www.atlassian.com 2023. 6. 13. 이전 1 2 3 다음