Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update til for git branching #341

Merged
merged 1 commit into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.