Skip to content

Commit

Permalink
docs: add info for change default branch to main on remote repo
Browse files Browse the repository at this point in the history
  • Loading branch information
mdsanima committed Apr 1, 2023
1 parent 2bdc17c commit fac5c48
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions docs/tutorials/how-to-rename-local-and-remote-git-branch.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
# {octicon}`telescope;1em;sd-text-secondary` `HOW TO RENAME LOCAL AND REMOTE GIT BRANCH`

When you want rename local and remote Git branches you can do very easily
using the `git branch -m` command on you terminal.
When you want rename local and remote Git branches you can do very easily using the `git branch -m`
command on you terminal.

This quick tutorial explains how to rename local and remote Git branches. You
only need to push the renamed local branch and delete the branch with the old
name.
This quick tutorial explains how to rename local and remote Git branches. You only need to push the
renamed local branch and delete the branch with the old name.

## RENAMING `GIT BRANCH`

First step is a switching to the local branch wchich you want to rename, simply
type in the terminal:
First step is a switching to the local branch wchich you want to rename, type in the terminal:

```shell
git checkout <old-branch-name>
Expand All @@ -22,15 +20,17 @@ Next step is a rename the local branch, type in the terminal:
git branch -m <new-branch-name>
```

Push the local `<new-branch-name>` to the remote repository and reset the
upstream branch by typing in the terminal:
Push the local `<new-branch-name>` to the remote repository and reset the upstream branch by typing
in the terminal:

```shell
git push origin -u <new-branch-name>
```

Finnaly you can delete the remote `<old-branch-name>` by typing in the
termianl:
When the new branch is on remote repository, go to `Settings` in Github or Azure repository and
change default branch to `main` then confirm the changes.

Finnaly you can delete the remote `<old-branch-name>` by typing in the termianl:

```shell
git push origin --delete <old-branch-name>
Expand Down

0 comments on commit fac5c48

Please sign in to comment.