<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hey,<div class=""><br class=""></div><div class="">I'd like to share with two git aliases which I've made special for MacPorts :)</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(155, 177, 180); background-color: rgba(255, 255, 255, 0.96);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><span class="Apple-tab-span" style="white-space:pre"> </span>cleanup = !git branch --merged origin/HEAD | grep -v ' -> ' | grep -v '^\\*' | xargs -n 1 git branch -d</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(155, 177, 180); background-color: rgba(255, 255, 255, 0.96);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><span class="Apple-tab-span" style="white-space:pre"> </span>rebaseall = !git branch --no-merged | xargs -n 1 git rebase origin/HEAD</span></div></div><div class=""><br class=""></div><div class="">The first one simple removed all branches which was merged into master.</div><div class=""><br class=""></div><div class="">The second one rebases all branches to master.</div><div class=""><br class=""></div><div class="">My usual workflow after I've opened a lot of PR to cleanup everything is:</div><div class="">git rebaseall</div><div class="">git checkout master</div><div class="">git cleanup</div><div class=""><br class=""></div><div class=""><div class="">
<div style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;">-- <br class="">wbr, Kirill</div>
</div>
<div><br class=""><blockquote type="cite" class=""><div class="">On 23. Feb 2022, at 15:10, Joshua Root <<a href="mailto:jmr@macports.org" class="">jmr@macports.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Gerben Wierda wrote:<br class=""><br class=""><blockquote type="cite" class="">But I have been advised a pull is not enough, I should first do a fetch.<br class=""></blockquote><br class="">If you're referring to my private reply, what I said was that a rebase was not enough to bring master up to date with upstream/master, you have to fetch as well.<br class=""><br class="">As per the git-pull man page:<br class=""><br class=""> git pull runs git fetch with the given parameters and<br class=""> then depending on configuration options or command line flags, will call<br class=""> either git rebase or git merge to reconcile diverging branches.<br class=""><br class="">Our project policy is to avoid merge commits.<br class=""><br class="">- Josh<br class=""><br class=""></div></div></blockquote></div><br class=""></div></body></html>