# git

## Rebase

rebase 는 병합이 필요한 commit 을 재생성해서(?) 일렬로 만들어 주므로 병합 과정에서 좀 더 공수가 필요하다.

{% embed url="<https://pearlluck.tistory.com/754>" %}

rebase 를 merge 와 비교하여 간단히 설명한 자료

{% embed url="<https://firework-ham.tistory.com/12>" %}

* merge 는 롤백 가능성이 있는 commit 을 병합할 때, 사용하면 좋겠다.
  * merge 는 병합 커밋을 만들기 때문에 병합 커밋만 revert (reset) 하면 됨
* rebase 는 커밋 그래프를 깔끔하게 만들어 주기 때문에 4인 이상 개발을 진행하는 팀에서 커밋 이력을 관리하기 좋다. rebase 를기본 정책으로 운영하는 것이 좋을 듯
* 결론
  * 기본적으로 commit 이 정리되어 있어야 함
  * 이슈 티켓을 commit 단위로 운영하는 것이 좋다.  다만, 너무  빡빡하게 이슈와   커밋을 연결하여 운영하는 것이 쉽지는 않을 듯 하다.\
    개발  팀 상황에 맞게 조율하면 될 것 같다.
  * rebase - merge 가 기본
  * 커밋 반영의 단위가 너무 크거나 롤백 가능성이 있다면 merge commit 을 사용하는 방법으로 처리

## 저장소 관리

{% embed url="<https://wiki.tistory.com/entry/git-remove-file-from-history>" %}

BFG 툴을 사용하면 대용량 파일 search 등의 작업을 손쉽게 할 수 있다.

{% embed url="<https://rtyley.github.io/bfg-repo-cleaner/>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://programmer-jjy.gitbook.io/second-brain/second-brain/devops/git.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
