Main WoT WebConf/Renaming Master to Main

From Web of Things Interest Group

Renaming Master to Main

See: Renaming the "master" branches to "main" (Member-only)

  • Make sure to update your forks and local copies
  • BEFORE making change in local copies or fork, check in all pending edits/updates
  • Do NOT rebase a fork until you make this change
  • To change in forks, look under Settings/Branches and change "master" to "main"
  • For local copies...
  • Simple way: delete and reclone
  • Alternatively, for local direct clones of the w3c repo
      1. git branch -m master main
      2. git fetch origin
      3. git branch -u origin/main main
  • See above link for instructions

You can understand what this does better by reading the git branch docs.

Here -m "moves" the branch (renaming master to main locally, basically) and -u associates a remote "upstream" branch with a local branch, so that git pull does the right thing (for instance). Note this means that you MUST update the remote first before trying to update your local copies. If you have other remotes you don't have to do anything, just either use the new branch name explicitly (e.g. git fetch upstream; git merge upstream/main) or make sure the upstream repo has renamed master to main if you want fetch and merge corresponding branches in one step using git pull upstream. Here upstream is the name that I (McCool) use for a remote pointing at the w3c repo in MY setup. I cloned my original local copies from my own fork on github, so I have origin pointing at my own fork. I then used git remote add upstream https://github.com/w3c/wot-testing to add an additional remote called upstream pointed at the corresponding W3C repo I can use for rebasing, etc. I do PRs by pushing up changes to my own fork, then doing PRs to the W3C repos from there using the web interface. See above link for more instructions.