Skip to content

Commit

Permalink
Merge pull request #341 from jermspeaks/content/til-git-branch-main
Browse files Browse the repository at this point in the history
Update til for git branching
  • Loading branch information
jermspeaks authored Feb 20, 2024
2 parents 9c11f2e + bce6617 commit 03e8185
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/content/writing/2024-02-12-TIL-bulk-rename.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
---
Expand Down
30 changes: 30 additions & 0 deletions src/content/writing/2024-02-20-TIL-rename-git-branch.md
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit 03e8185

Please sign in to comment.