---
title: "Discussion on \"Script for recreating a branch from the main branch\" | Hashnode"
description: "Discussion on \"Script for recreating a branch from the main branch\". Many a times we need to delete and recreate a branch both locally and remotely and sync it with the main branch. \nIn our firm too we were doing this a lot of times. So, we decided to write a shell script to ease this task.\nWe will be discussing that ..."
url: "https://hashnode.com/posts/script-for-recreating-a-branch-from-the-main-branch/61f13df4e247b2151e621148"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Script for recreating a branch from the main branch](https://sarthak-on-code.hashnode.dev/script-for-recreating-a-branch-from-the-main-branch?utm_source=hashnode&utm_medium=feed)

Many a times we need to delete and recreate a branch both locally and remotely and sync it with the main branch. In our firm too we were doing this a lot of times. So, we decided to write a shell script to ease this task. We will be discussing that ...

Jan 26, 2022 · 1 min read · sarthak-on-code.hashnode.dev  
Updated Apr 10, 2022  
Read the article

-   [#bash](https://hashnode.com/tag/bash)
-   [#git](https://hashnode.com/tag/git)
-   [#shell](https://hashnode.com/tag/shell)
-   [#automation](https://hashnode.com/tag/automation)

## Written by

[Sarthak Srivastava](https://hashnode.com/@Sarthak98)

@Sarthak98 · India

  
[View profile](https://hashnode.com/@Sarthak98)

Frontend Developer at Groww.in

You may have a look at the projects I have worked on through my Github profile (https://github.com/SarthakSri98) or my portfolio (https://sarthaksri98.github.io/The-Portfolio).

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
