Ok, I've created an origin/origin/master
branch and I've pushed it. I'm scared to do some remove operations. Whan can I do? Is it safe to run a remove operation?
Deleting remote branches To delete a remote branch, you can't use the git branch command. Instead, use the git push command with --delete flag, followed by the name of the branch you want to delete. You also need to specify the remote name ( origin in this case) after git push .
Steps to delete remote Git branches Issue the git push origin –delete branch-name command, or use the vendor's online UI to perform a branch deletion. After the remote branch is deleted, then delete the remote tracking branch with the git fetch origin –prune command.
origin master is the branch master on the remote origin. origin/master ( A representation or a pointer to the remote branch) This is incorrect... origin master is not a branch... it is in fact two separate things, "origin" (a remote) and "master" (a local branch). The state of the remote master branch, is present locally, right?
Here, origin is the remote repository and origin/master is the master branch on the remote repository. So what two branches are being merged? Thanks in advance! All parameters to 'git merge' in this case are branches that you're merging from, i.e. source branches. You're always merging to the current branch.
First we need fetch origin, which is slightly different from pull, as it will not try to merge. To reset repository to our remote master we need to reset it hard specifying reset point to origin/master .
Given the fact that you can switch to origin/master (though in detached state) while having your network cable unplugged, it must be a local representation of the master branch at origin. In the answers above and below, people say origin/master is the remote master branch.
Don't worry, you can always go back with git. Make sure you have your master branch locally, then try this one:
git push origin :origin/master
It will delete origin/master branch on a remote "origin".
If you want to be supersafe, rename your remote from "origin" to "temp", then do:
git push temp :origin/master
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With