Accidentally pushed a temporary branch to the origin, want to drop it

I created a local temp drop branch and accidentally called

 git push --all origin 

which added it to my github registry.

Then I deleted the temp branch locally and made another

 git push --all origin 

but the branch still exists on github, although it is no longer associated with the main branch. How can I tell the remote repo so that git gets rid of the temp branch?

+4
source share
1 answer

The following command will solve your problem

git push origin :temp

This command should be understood as "replace the remote temp branch with"

alternatively, you can also do the following, which is a shortcut to the above.

git push --delete origin temp

For more information, you can refer to the documentation .

+8
source

Source: https://habr.com/ru/post/1438059/


All Articles