From bce6617cb379678c87c37f3fbdfaf91e23f6efb9 Mon Sep 17 00:00:00 2001 From: jermspeaks Date: Tue, 20 Feb 2024 12:02:09 -0800 Subject: [PATCH] Update til for git branching --- .../writing/2024-02-12-TIL-bulk-rename.mdx | 2 +- .../2024-02-15-TIL-regex-decimal-points.mdx | 2 +- .../2024-02-20-TIL-rename-git-branch.md | 30 +++++++++++++++++++ 3 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 src/content/writing/2024-02-20-TIL-rename-git-branch.md diff --git a/src/content/writing/2024-02-12-TIL-bulk-rename.mdx b/src/content/writing/2024-02-12-TIL-bulk-rename.mdx index bc2c024a..7c926db4 100644 --- a/src/content/writing/2024-02-12-TIL-bulk-rename.mdx +++ b/src/content/writing/2024-02-12-TIL-bulk-rename.mdx @@ -3,7 +3,7 @@ description: "Using the rename utility" draft: false pubDate: "2024-02-12" tags: ["TIL", "programming"] -title: Bulk Rename MacOS CLI +title: TIL Bulk Rename MacOS CLI coverImage: '../../images/TIL.png' heroImageAlt: Image from Boston University showing Today I learned --- diff --git a/src/content/writing/2024-02-15-TIL-regex-decimal-points.mdx b/src/content/writing/2024-02-15-TIL-regex-decimal-points.mdx index 4a0b456e..7a5fd8a9 100644 --- a/src/content/writing/2024-02-15-TIL-regex-decimal-points.mdx +++ b/src/content/writing/2024-02-15-TIL-regex-decimal-points.mdx @@ -3,7 +3,7 @@ description: "Creating a regular expression for decimal points" draft: false pubDate: "2024-02-15" tags: ["TIL", "programming"] -title: Regex for Decimal Points +title: TIL Regex for Decimal Points coverImage: '../../images/TIL.png' heroImageAlt: Image from Boston University showing Today I learned --- diff --git a/src/content/writing/2024-02-20-TIL-rename-git-branch.md b/src/content/writing/2024-02-20-TIL-rename-git-branch.md new file mode 100644 index 00000000..4243cfa5 --- /dev/null +++ b/src/content/writing/2024-02-20-TIL-rename-git-branch.md @@ -0,0 +1,30 @@ +--- +description: "Instructions on changing remote and local git branches from master to main" +draft: false +pubDate: "2024-02-20" +tags: ["TIL", "git", "programming"] +title: TIL how to rename my master branch to main +coverImage: '../../images/TIL.png' +heroImageAlt: Image from Boston University showing Today I learned +--- + +For my GitHub repo, I wanted to rename the remote `master` branch to `main`. + +[These instructions](https://github.com/github/renaming) helped the process. + +Go to **Settings**, then **Branches**, then edit the `master` branch. Rename them to `main`. + +![Renaming the default branch dialog](https://github.com/github/renaming/raw/main/rename-default-branch-dialog.png) + +You will have to do it locally as well. The command for local machine is as follows. + +```sh +git branch -m master main +``` + +Afterward, you may need to reattach `main` to `origin/main`. Follow the instructions +on the terminal as necessary. + +### Why change to `main`? + +This ZDNet article covers [GitHub to replace "master" with alternative term to avoid slavery references](https://www.zdnet.com/article/github-to-replace-master-with-alternative-term-to-avoid-slavery-references/). It took them awhile, so many of my old repos haven't been updated accordingly.