Skip to main content

Posts

Showing posts with the label git

Rename a git branch

By mistake If you have named a branch incorrectly and pushed this to the remote repository then you are at correct place. Rename your local branch. If you are on the branch you want to rename: git branch -m new-name If you are on a different branch: git branch -m old-name new-name Delete the old-name from remote and push new-name git push origin :old-name new-name Reset the upstream for new-name Switch to the branch and then git push origin -u new-name

How to delete a Git branch on Local and Remote

Goal: If you are done with your work and as a archival policy if you want to delete a branch from local as well as git server. This article can help you. Delete Branch on local git branch -D <Branch_Name> Delete Branch on server git branch :<Remote_server_Name><Branch_Name_on_Remote> Sample git branch -D deployed_feature git branch :origin deployed_feature