SCRT-HQ / PSGSuite

Powershell module for Google / G Suite API calls wrapped in handy functions. Authentication is established using a service account via P12 key to negate the consent popup and allow for greater handsoff automation capabilities
https://psgsuite.io/
Apache License 2.0
235 stars 67 forks source link

NOTICE: Primary branch switched to `main` #299

Closed scrthq closed 4 years ago

scrthq commented 4 years ago

Background + Details around why:

CC @FISHMANPET @WJurecki

FISHMANPET commented 4 years ago

FYI I followed the instructions in the first link with my fork and got myself into a bit of a pickle, as someone that's not super familiar with Git and was just copy and pasting commands.

After I did the things mentioned in that first piece (and specifically git branch -m master main) I ended up with main being my default branch according to GitHub Desktop, but everytime I deleted master in GitHub, GitHub Desktop had me republish my main and it would create a master again in my fork. The GitHub Desktop client was also sort of acting like master was my default - it explicitly said main was my default, but the menus still said "Update from master" rather than "Update from main." Based on someone reporting the same issue with GitHub Desktop I used some of the troubleshooting steps there, and found that my local main was pointing to remote master (notice Local branches configured for 'git pull':).

PS C:\Users\bajurny\Documents\GitHub\PSGSuite> git remote show origin
* remote origin
  Fetch URL: https://github.com/FISHMANPET/PSGSuite.git
  Push  URL: https://github.com/FISHMANPET/PSGSuite.git
  HEAD branch: main
  Remote branches:
    feature/ContactMgmt_issue53          tracked
    feature/add_ConfigName_parameter     tracked
    feature/sheets_batch_update          tracked
    feature/use_queues_for_Drive_uploads tracked
    feature_requests_125_150_152         tracked
    gh-pages                             tracked
    gsheets                              tracked
    main                                 tracked
    master                               tracked
  Local branches configured for 'git pull':
    gsheets merges with remote gsheets
    main    merges with remote master
  Local refs configured for 'git push':
    gsheets pushes to gsheets (up to date)
    main    pushes to main    (up to date)

I found the result in the script posted in the second link. I needed to run this to update local main to pull from remote main:

git push origin -u ${DEFAULT}

Not sure if I could have done that instead of git push origin HEAD mentioned in the first article.

So maybe this information will be useful for others.

scrthq commented 4 years ago

Thanks for the diligence here @FISHMANPET ! ♥️ I should have probably clarified that this really only affects the target branch you're submitting your PRs for, what you have in your fork doesn't need to line up exactly 🙂

FISHMANPET commented 4 years ago

I figured I'd give it a try here since I know I'll be doing it for other repos I own, and if I screwed up my fork badly enough I could just delete it and start over. It's the kind of thing I suspect lots of people will be doing so the more information on how to do it safely the better!

scrthq commented 4 years ago

Very fair! ♥️