Hi!
I have a strange problem here :)
I tried to push other repository from github to my bitbucket repository branch, but I incorrectly choose branch and github repository are pushed to my master. I know, this is strange, but actually I wanted two repos in my bitbucket (just in different branches).
Now, I have problem with history. In commits history I see a lot commits from github, when I choose commit, it shows that it is from master, but in master is only my commits.
I don't know to fix this issue. I can't delete these commits, because git can't see they in master.
If I am understanding correctly, local "master" is correct, but "origin/master" is incorrect?
From your local clone try this:
git fetch
git log origin/master
If the "git log origin/master" result matches the branch you want to delete (since it's this 'master' you accidentally pushed from the wrong repository), you can delete it like so:
git push --delete origin refs/heads/master
And then push back up the correct master (the local master), like so:
git checkout master
git push
If your local master was a bit stale it might be better to find someone else on your team that had a more up-to-date version and push from their clone. Alternatively, it might be possible to get Atlassian Bitbucket customer support to help you recover from the bad push.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.