Horje
How To Delete Remote Branch in Git?

Git is an important tool in the process of application development and is used widely in the software industry by developers to maintain the codebase. Using this developers are able to organize their codebase and manage the version history of their project.

Now, as a developer, you need to know how to delete a Git branch because it will lead to a better productivity approach, and for that, we have discussed ways to delete Git branches. In this article, I’ll guide you through the entire process of deleting a git remote branch.

Steps to Delete Remote Branch in Git:

Step 1: To see all the branches, write this command in your terminal

git branch

gtbScreenshot-(291)

Step 2: To completely remove a remote branch, you need to use the git push origin command with a -d flag, then specify the name of the remote branch.The command is as follow:

git push origin -d branch-name

For example: to remove the new_branch branch, I will run git push origin –d new_branch:

git push origin –d new_branch
Screenshot-(292)

How To Delete Remote Branch in Git?

You can see the remote branch, new_branch, is not listed anymore. If you check GitHub again, it won’t be there:

Screenshot-(293)



Reffered: https://www.geeksforgeeks.org


Git

Related
How to Undo Git Reset? How to Undo Git Reset?
How to Ignore 'node_modules' Folder in Git? How to Ignore 'node_modules' Folder in Git?
Difference between .gitignore and .gitkeep Difference between .gitignore and .gitkeep
How to View Git Log of One User's Commits? How to View Git Log of One User's Commits?
How to Undo Working Copy Modifications of One File in Git? How to Undo Working Copy Modifications of One File in Git?

Type:
Geek
Category:
Coding
Sub Category:
Tutorial
Uploaded by:
Admin
Views:
14