[퍼온글 백업] 브랜치 삭제 후, 동명의 브랜치 사용 가능한지 여부

2023. 1. 17. 15:54Backup

https://eastash.me/delete-git-and-create-same-name-branch

 

Git 브랜치를 삭제한 이후, 다음에 같은 이름의 브랜치를 사용하는 것은 괜찮을까?

💡 저희 팀은 저번 회의에서 PR Merge 이후에 merge된 branch는 삭제하는 것이 좋을지에 대한 논의를 했었어요. GitFlow를 살펴보니 보통 pull request 이후에 merge 된 branch는 삭제한다는 전략을 사용한다

eastash.me

세줄요약

  1. 일단가능
  2. 리모트에서 브랜치를 삭제한경우 → 로컬에서 업스트림 참조를 끊어주고 다시 연결해야 한다
  3. 혹은 prune을 이용해서 remote에서 삭제된 브랜치 상황을 로컬에 업데이트 해줘야 한다.

https://pers0n4.io/github-remote-repository-and-upstream/

https://stackoverflow.com/a/32877594/10194999

 

Can you re-use deleted Git branch names?

If I create a Git branch named "foobar", do some work in it, merge it back into my development branch and then delete the foobar branch, can I create another branch at some future point with the same

stackoverflow.com

Yes, no problem. Branch names are only for humans anyway. Git only cares about SHAs.