본문 바로가기

협업

(21)
git branch 이름에 slash 문자 사용 git 분기에 develop이 있고 master가 있다. 브랜치를 생성할때 slash를 통해 branch간의 계층구조를 나타내고 싶은 요구사항이 있을 수 있다. 만약 화면 개발을 한다고 할때 모바일과 웹개발을 동시에 진행해야하고 develop 브랜치 하위에 mobile브랜치와 web 브랜치를 만들고 싶다고 가정하면 develop/mobile develop/web 과 같이 브랜치를 생성하고 싶을 것이다. 이런 경우 develop 브랜치를 삭제하고 다시 만들어야 develop/web, develop/mobile 과 같이 생성이 가능하다. 위와 같이 생성하고 ref를 가보면 develop 디렉토리와 web 파일, mobile파일이 생성되는 것을 알 수 있다.\ 만약 여기서 develop 브랜치를 생성하려고 한..
Git Prune 에 대해 알아보자 git pull (fetch) 과정에서 ref lock 에러를 마딱뜨렸는데, 이 때 해결방법중 하나가 'git remote prune origin' 을 수행하는 것이라 한다. 그래서 이 녀석의 정체에 대해 알아보고자 한다. $ git remote prune origin git prune 은 unreachable 한 git object 들을 "local" 에서 clean 하는 작업이다. unreachable 이란 git tree 에 의해 참조되지 않는 gc 대상이 되는 dangling refs 들이다. git prune 은 보통 직접 수행되지 않는다. 이 녀석은 git gc 의 child command 이다. git prune 을 수행할 때 --dry-run --verbose 옵션을 주면 실제 수행되지는 ..
untracked working tree files would be overwritten 에러 메시지 The following untracked working tree files would be overwritten by checkout -> git이 추적하고 있지않은 파일들이 checkout 작업에 의해 덮어씌어질 것이다. 해결 방법 untracked file들을 모두 제거하는 명령어를 실행합니다. # git clean -fd --dry-run git clean git이 추적하고 있지 않는 파일을 제거하는 명령어 -fd 옵션 f : 파일 d : 디렉토리 --dry-run
shell 프롬프트에 git branch 표시 https://junho85.pe.kr/1150
git 로그 보기 git 사용자 목록 보기 현재 브랜치 사용자 목록 $ git shortlog -sne 모든 브랜치 사용자 목록 $ git shortlog -sne --all 옵션을 사용해서 보기 $ git log --pretty="%an %ae%n%cn %ce" | sort | uniq %an author name %ae author email %n new line %cn committer name %ce committer email https://stackoverflow.com/questions/9597410/list-all-developers-on-a-project-in-git git 브랜치 정보 확인 브랜치 간에 비교할 때 $ git log branch_name_1"..branch_name_2 브랜치 간의 코드를 ..
git 주요 명령어 정리 git log의 유용하게 쓰이는 몇몇 옵션들을 정리해 봅니다. 자세한 사용법은 Git의 기초 - 커밋 히스토리 조회하기를 참고하세요. 출력 log 제한 git log -(n) 최근 N개의 log만 출력 $ git log -2 --pretty=oneline 7343a5f82686c8c94800ddf8d2cffb30f6160243 modify m3 5a65f7acf00b6c18285bc0396d463f6a7c506c91 modify m2 git log --since[after,until,before] 특정 날짜 이전/이후 commit만 조회 $ git log --since="2017-01-29" commit 7343a5f82686c8c94800ddf8d2cffb30f6160243 Author: unknown..
reset 한 것 취소하는 방법 원래는 remote 에 올리지 않은 여러 commit 이 있는 상태에서 한참 개발 중에 잠시 이전 commit 소스로 돌아가서 확인 좀 하려 했다. 믈론 check out 으로 이동해도 되지만, 현재까지 작성한 코드랑 계속 충돌난다며 check out 이 잘 안되길래 git reset을 써서 전 버젼으로 돌아가서 확인하던 중. 다시 최근 소스로 돌아오려고보니 commit log들이 다 없어졌다.... 소스트리 쓰다보면 가끔 느려서 답답할때가 많은데 이럴땐 참 친절하게 새로고침도 빠르게 알아서 잘해줘...^^ git reflog를 치면 $ git reflog 3f6db14 HEAD@{0}: HEAD~: updating HEAD d27924e HEAD@{1}: checkout: moving from d279..
git pull 시 문제 해결 아래는 git pull 을 하면 가끔 발생하는 에러들입니다. 자주 까먹어서 헤메는 내용이라 정리해둡니다. error: Your local changes to the following files would be overwritten by merge: [파일들...] Please, commit your changes or stash them before you can merge. error: The following untracked working tree files would be overwritten by merge: [파일들...] Please move or remove them before you can merge. error: You have not concluded your merge (MERGE..