<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="">Given my absolute lack of decent git skills (and it’s just too complicated for a fast skill increase) I have the following setup (which so far worked)<div class=""><br class=""></div><div class="">I have a macports-ports clone on GitHub which I use locally. I need a clone or I cannot create pull requests.</div><div class=""><br class=""></div><div class="">When I have to do a reset, I:</div><div class=""><br class=""></div><div class="">- save my changed files outside the git tree</div><div class="">- then:</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=""># To reset the current reporsitory to what is in upstream (my repo is called 'local', upstream is called 'origin')</span></div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; min-height: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></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="">   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="">   git reset --hard origin/master</span></div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; min-height: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></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=""># I push the local store to my cloned repository on github:</span></div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; min-height: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></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="">   git push</span></div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; min-height: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></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="">After this, my repo on <a href="http://github.com" class="">github.com</a> (gctwnl/macports-ports) and my local copy of my own repo are in sync with macports/macports-ports</span></div></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class="">Or so I thought. But I just tried this and I get:</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 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=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class="">So, apparently my ‘reboot’ isn’t hard enough. What went wrong? How do I</div><div class=""><br class=""></div><div class="">- reset my clone (both local and on <a href="http://GitHub.com" class="">GitHub.com</a>) to the current HEAD of the official repo in a way that <i class="">always</i> works?</div><div class=""><br class=""></div><div class="">G</div></body></html>