<div dir="ltr"><div>Probably a silly question:<br></div><div><br></div><div>I'm having problems with rebasing my local feature branches for PRs, e.g. for <a href="https://github.com/OSGeo/grass/pull/1786">https://github.com/OSGeo/grass/pull/1786</a></div><div>My local main branch is up to date with the official main branch. In my case the grass repo is the remote named origin, my fork is the remote named metzm</div><div><br></div><div>$ git checkout raster_tempdir<br>$ git rebase main<br><br>Successfully rebased and updated refs/heads/raster_tempdir.<br><br>$ git status <br>On branch raster_tempdir<br>Your branch and 'metzm/raster_tempdir' have diverged,<br>and have 48 and 7 different commits each, respectively.<br>  (use "git pull" to merge the remote branch into yours)<br><br>$ git push metzm raster_tempdir<br>! [rejected]            raster_tempdir -> raster_tempdir (non-fast-forward)<br>error: failed to push some refs to 'github.com:metzm/grass.git'<br>hint: Updates were rejected because the tip of your current branch is behind<br>hint: its remote counterpart. Integrate the remote changes (e.g.<br>hint: 'git pull ...') before pushing again.<br>hint: See the 'Note about fast-forwards' in 'git push --help' for details.</div><div><br></div><div>Any hints on how to proceed from here without messing up the history of my feature branch? Thanks!</div><div><br></div><div>Markus M</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Aug 22, 2021 at 9:26 PM Vaclav Petras <<a href="mailto:wenzeslaus@gmail.com">wenzeslaus@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Dear all,</div><div><br></div><div>The master branch was renamed to main. Please update your local repositories and workflows accordingly.<br></div><div><br></div><div>## 1. Local repo update and branch rename<br></div><div><br></div><div>If you are contributing code or compiling source code from Git, you need to modify your local repository as well. Go to your fork's website on GitHub. It will warn you about the rename in the OSGeo repo. Go to settings and to the rename. Go to the main page of your fork again. Now it will warn you about the rename in your repo (your fork). It will give you instructions on renaming the local branch and making it point to the renamed branch. (The assumption is that your fork repo is the remote named origin.)<br></div><div></div><div><br><div>Additionally, there still will be upstream/master and you can remove it using (assuming upstream remote is the OSGeo repo. You can remove upstream/master and update info about the default branch using:<br></div><div><br></div><div>git fetch upstream --prune</div><div>git remote set-head upstream -a</div></div><div><br></div><div></div><div>Alternatively, if you are not keeping your fork's master/main branch up to date, you can follow instructions from my initial email which allow you to skip the fork part resulting in a slightly different local setup.<br></div><div><br></div><div>## 2. Updating your contributing steps</div><div><br></div><div>To update your local main branch (base branch) and to rebase or merge with the latest source code, use upstream/main instead of upstream/master. <br></div><div><br></div><div>## 3. Updating workflows using source code from Git</div><div><br></div><div><div></div><div>If you have a workflow which is using the source code obtained from Git , you will need to update it if you explicitly specify the branch name. If you do --branch, checkout, or switch, and at the same time 
using the master branch, you will need to change "master" to "main". If you use only a
simple `git clone`, no changes are needed because `git clone` takes the default branch which will continue to work.</div><div><br></div><div>## 4. Other issues<br></div><div><br></div><div>The base branch for PRs was changed automatically. The PRs updating most of the source code for core and addons were merged. Some CI-related changes will still be needed for core. Additionally, I assume the workflows outside of the source code will be updated as part of the updates to addons repo structure and changes for the release branch for 8.0. Help in this area is welcome.<br></div><div><br></div><div><a href="https://github.com/OSGeo/grass/pull/1806" target="_blank">https://github.com/OSGeo/grass/pull/1806</a></div><div><a href="https://github.com/OSGeo/grass-addons/pull/598" target="_blank">https://github.com/OSGeo/grass-addons/pull/598</a></div><div><br></div><div>Let me know if you face any questions.</div><div><br></div><div>Best,</div><div>Vaclav<br></div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Aug 18, 2021 at 10:41 PM Vaclav Petras <<a href="mailto:wenzeslaus@gmail.com" target="_blank">wenzeslaus@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Dear all,</div><div><br></div><div>I will rename our default branch currently called master to main in the following days. We already discussed it here and there, but the rename should be relatively smooth. Much simpler than the addons repo reorganization. Users  not compiling code themselves should not be affected. Contributors will be, but GitHub warns you about the rename when you come to the repo web page. Those compiling from source may need to make changes.<br></div><div><br></div><div>The update of a local clone can be done with instructions similar to the following (I will post them again once I confirm it is the best fit):<br></div><div><br></div><div>git branch -m master main<br>git fetch upstream<br>git branch -u upstream/main main<br>git remote set-head upstream -a<br><br>Additionally, to get rid of upstream/master, do:<br><br>git fetch --prune</div><div><br></div><div>You don't need to update your fork unless you want to.<br></div><div><br></div><div>The changes needed in the repo are already in a PR (feel free to review):<br></div><div><br></div><div><a href="https://github.com/OSGeo/grass/pull/1806" target="_blank">https://github.com/OSGeo/grass/pull/1806</a></div><div><br></div><div>Those compiling from source code obtained from Git will need to make changes when they explicitly specify the branch. A simple `git clone` takes the default branch which will continue to work. However, if you do --branch, checkout, or switch, and at the same time using the master branch, you will need to change "master" to "main".</div><div><br></div><div>Let me know if you have any questions or concerns.<br></div><div><br></div><div>Best,</div><div>Vaclav<br></div></div>
</blockquote></div>
_______________________________________________<br>
grass-dev mailing list<br>
<a href="mailto:grass-dev@lists.osgeo.org" target="_blank">grass-dev@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/grass-dev" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/grass-dev</a><br>
</blockquote></div>