<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">OK. I'm back in git hell (suggestions made on this list, tips on stackexchange, git documentation, nothing gives me the answer)<div class=""><br class=""></div><div class="">I have </div><div class=""><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">albus:macports-ports sysbh$ git remote -v</span></div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">local<span class="Apple-tab-span" style="white-space:pre">       </span><a href="https://github.com/gctwnl/macports-ports.git" class="">https://github.com/gctwnl/macports-ports.git</a> (fetch)</span></div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">local<span class="Apple-tab-span" style="white-space:pre">   </span><a href="https://github.com/gctwnl/macports-ports.git" class="">https://github.com/gctwnl/macports-ports.git</a> (push)</span></div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">origin<span class="Apple-tab-span" style="white-space:pre">   </span><a href="https://github.com/macports/macports-ports.git" class="">https://github.com/macports/macports-ports.git</a> (fetch)</span></div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">origin<span class="Apple-tab-span" style="white-space:pre">      </span><a href="https://github.com/macports/macports-ports.git" class="">https://github.com/macports/macports-ports.git</a> (push)</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class="">So, my clone is ‘local’, the upstream repository is ‘origin’ (some instructions tend to call this ‘upstream’, others ‘origin’, there seem to be two ’sops’ on this in gitland</span>. I think now that using ‘upstream’ is the better choice as git defaults to ‘origin’ when no argument is given. So, I need to rename too. But first let’s see if I can get this thing working in the first place).</div><div class=""><br class=""></div><div class="">If I produce a pull request and I’m rebuffed because of an error I make, I need to go back to testate of the official repository before proceeding again. At such a point my own clone is both commits ahead and commits behind the official repository. I need to lose my commits (as I am rebuffed by macports maintainers if I have multiple ‘working’ commits in my pull request). So, I need to reset my clone to the current state of the official repository.</div><div class=""><br class=""></div><div class="">So, my clone is now two commits ahead of the official macports repository and 343 commits behind. I need to reset my clone to be the same as the official repository. The result of which is:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">albus:macports-ports sysbh$ git fetch origin</span></div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">albus:macports-ports sysbh$ git reset --hard origin/master</span></div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">HEAD is now at dfb14de3eb5 pypy*-tkinter: ensure UsingTheRightCompiler</span></div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">albus:macports-ports sysbh$ git push</span></div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Username for '<a href="https://github.com':" class="">https://github.com':</a> <a href="mailto:gerben.wierda@rna.nl" class="">gerben.wierda@rna.nl</a></span></div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Password for '<a href="https://gerben.wierda@rna.nl@github.com':" class="">https://gerben.wierda@rna.nl@github.com':</a> </span></div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">To <a href="https://github.com/gctwnl/macports-ports.git" class="">https://github.com/gctwnl/macports-ports.git</a></span></div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #b42419" class="">! [rejected]               </span><span style="font-variant-ligatures: no-common-ligatures" class=""> master -> master (non-fast-forward)</span></div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(180, 36, 25);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">error: failed to push some refs to '<a href="https://github.com/gctwnl/macports-ports.git" class="">https://github.com/gctwnl/macports-ports.git</a>'</span></div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(159, 160, 28);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">hint: Updates were rejected because the tip of your current branch is behind</span></div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(159, 160, 28);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">hint: its remote counterpart. Integrate the remote changes (e.g.</span></div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(159, 160, 28);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">hint: 'git pull ...') before pushing again.</span></div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(159, 160, 28);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">hint: See the 'Note about fast-forwards' in 'git push --help' for details.</span></div></div><div class=""><br class=""></div><div class="">I don’t want to “Integrate the remote changes”, I want to lose them. How??</div><div class=""><br class=""></div><div class="">G</div><div><br class=""><blockquote type="cite" class=""><div class="">On 10 Jan 2020, at 08:57, Michael <<a href="mailto:keybounce@gmail.com" class="">keybounce@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=windows-1252" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div class=""><div class="">On 2020-01-09, at 2:33 PM, Steven Smith <<a href="mailto:steve.t.smith@gmail.com" class="">steve.t.smith@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite" class=""><meta http-equiv="content-type" content="text/html; charset=utf-8" class=""><div dir="auto" class=""><div dir="ltr" class="">Me too. We’re discussing MacPorts-relevant git commands in <a href="https://github.com/macports/macports-ports/pull/6106" class="">https://github.com/macports/macports-ports/pull/6106</a> .</div><div dir="ltr" class=""><br class=""></div><div dir="ltr" class="">Easiest, most destructive to local:</div><div dir="ltr" class=""><br class=""></div><div dir="ltr" class=""># save all local files changed outside the git repo</div><div dir="ltr" class=""><br class=""></div><div dir="ltr" class="">git fetch --all</div><div dir="ltr" class="">git reset --hard upstream/master</div><div dir="ltr" class=""><br class=""></div><div dir="ltr" class=""># restore all local files</div></div></blockquote><br class=""></div><div class="">I'm sorry, I just have to follow up with this xkcd ...</div><div class=""><br class=""></div><div class=""><a href="https://xkcd.com/1597/" class="">https://xkcd.com/1597/</a></div><div class=""><br class=""></div></div></div></blockquote></div><br class=""></div></body></html>