0

Background

  • macOS 10.12
  • SourceTree 3
  • GitHub
  • Bitbucket
  • Django Project

What I have Done

  • Filenames are changed for privacy reasons
  • I wanted to push a previously committed version to GitHub than to Bitbucket
  • This worked for a long while but since this new sticking out baranch this doesent woks and I get this error message (this sticking out RED branch can and should be deleted)
  • I have rebased before to the commit just before that sticking out branch by git reset --hard COMITIDNAME

enter image description here enter image description here

Pop up ERROR message

git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree push -v --tags --set-upstream origin refs/heads/HEAD:refs/heads/HEAD 
Pushing to https://github.com/myusernameongithub/myprojectnameongithub.git
error: src refspec refs/heads/HEAD does not match any.
error: failed to push some refs to 'https://github.com/myusernameongithub/myprojectnameongithub.git'
Completed with errors, see above

Goal

  • I want to keep only 1 tag and move forward with that, use that in the future to upload in the future to both GitHub and Bitbucket (or if needed because of the 2 git storage places that minimum amount of more tags)
  • Being able to upload my gits to Github and Bitbucket

What I have tried/looked up

sogu
  • 1,161
  • 2
  • 11
  • 47

1 Answers1

0

Solution

  • Right click on the head tag that you can see on the 1st picture
  • chose branch
  • chose Delete branches delete all the branches you don't want to have (it is important that remote beaches are added that are up in your server + branches that you keep locally, so pay attention what is what)
  • than git reset --hard COMMIT_NEMUR_AND_LETTERS this jumps you back to that given branch and deletes everything above it.
sogu
  • 1,161
  • 2
  • 11
  • 47