#TIL git diff 문맥 파악에 도움을 주는 hunk-header
git diff에서 변경된 줄을 나타내는 Hunk를 보여준다. @@ -418,6 +418,8 @@ 이런 식으로 라인 넘버를 같이 표시해 준다. 여기에 header를 출력해 변경 사항에 정보를 제공한다. 예를 들어 header에 포함된 함수나 클래스 선언을 보여줄 수 있다. 라인 넘...
git diff에서 변경된 줄을 나타내는 Hunk를 보여준다. @@ -418,6 +418,8 @@ 이런 식으로 라인 넘버를 같이 표시해 준다. 여기에 header를 출력해 변경 사항에 정보를 제공한다. 예를 들어 header에 포함된 함수나 클래스 선언을 보여줄 수 있다. 라인 넘...
GitHub에 있는 커밋을 내 저장소에 적용하고 싶다. 리모트 저장소로 등록을 안 한 상태라서 git cherry-pick 명령은 사용하지 못한다. 어떻게 하면 될까?
이번에 배포한 브랜치를 언제 땄더라. a 커밋이 이번에 배포한 브랜치에 포함되었나?
$ git pull ... Unlink of file 'xxxx' failed. Should I try again? (y/n)
$ git tag --list ‘v0.2*' --sort=-v:refname v0.2.25 v0.2.24 v0.2.23 v0.2.19 v0.2.18 v0.2.17 v0.2.16 v0.2.15 v0.2.14 v0.2.13 v0.2.12
빌드 머신 저장 공간이 가득 찰 일은 없겠지? 저장 공간 FULL이 나서 빌드 몇 번 실패해보면 정신을 차린다. 너무 헤프게 쓰고 있었구나. 게다가 mac mini라 저장 공간을 바로 늘릴 수도 없다. 필요한 것만 checkout 해서 쓰자. checkout 속도가 빨라져 빌드하는...
$ git add sample.sh $ git update-index --chmod=+x sample.sh
$ git archive --format=tar origin/master \ | gzip -9c \ | ssh USER@SERVER "mkdir -p TARGET_DIR; tar --directory=TARGET_DIR -xvzf -"
$ git checkout master $ git merge -s ours obsolete-branch
$ git push origin :feature-1
$ cd existing_repo $ git remote rename origin old-origin $ git remote add origin new_repo_url $ git push -u origin --all $ git push -u origin --tags $ git re...
충돌(conflict)이 발생했을 때, 한쪽 변경 사항을 적용하고 싶다. 주로 테스트 데이터 커밋이다. 코드 변경 사항과 섞여 들어가지 않게 데이터만 따로 커밋을 만든다. push 전에 걸러내면 되니깐. 중앙 저장소에 있는 커밋을 로컬로 가져왔는데, 데이터에서 충돌이 발생했다. 이...
$ cat .git/HEAD ref: refs/heads/master
$ cat .gitignore *.c
$ git fetch
$ git checkout --track origin/serverfix
$ git config --global alias.stsh 'stash --keep-index' $ git config --global alias.staash 'stash --include-untracked'
$ git fetch --prune $ git pull --prune
Update <2025-03-22 Sat> Git 2.37에 추가됐다 git config --global push.autoSetupRemote true 설정 후 git push 를 하면 리모트 브랜치를 자동으로 설정해준다.
ohyecloudy@air5 ~/project/ddiary (master) $
$ git log -SText
$ git add -p <pathspec>
Start an interactive rebase with git rebase -i <commit>^, where is the commit you want to split. In fact, any commit range will do, as long as...
C:\> svn info %SVN_URL%/branches/%BRANCH_NAME% C:\> git ls-remote --exit-code --heads %GIT_URL% %BRANCH_NAME%