3  Common Processes

3.1 Rename Default Branch from Master to Main

On GitHub’s website click on  # branches icon at the top left of the code on the home page of a repository. You should see a window that specifies all the current branches as well as the default branch. Click on the edit icon (pencil on far right) to rename a branch.

After renaming the branch on the web interface, then go to your local clone, open bash and type in the following:

git branch -m master main
git fetch origin
git branch -u origin/main main
git remote set-head origin -a

3.2 Cache GitHub Credentials - Windows

Old way, view in Wayback Machine

New way, using GitHub CLI or Git Credential Manager

  1. After installing git on a new machine, I cloned a test repository (via an RStudio .Rproj) made a small text edit and committed the change. When I tried to push the commit to GitHub the following window popped-up asking me to sign in. I selected Sign in with your browser.
    GitHub credential manager step 1
  2. After selecting Sign in with your browser, a window popped up in my default browser where I signed in to my GitHub account. The next screen asked to authorize the credential manager, which I did by selecting Authorize GitCredentialManager.
    GitHub credential manager step 2
  3. After selecting Authorize GitCredentialManger the following screen appeared stating that authentication succeeded. After this, I am able to push/pull from my machine to GitHub.
    GitHub credential manager step 3

3.3 Git Bash Terminal in R Studio

Tools > Global Options > Terminal > New Terminals open with: Git Bash