Home > database >  How to fix the missing Develop Branch in remote in Sourcetree?
How to fix the missing Develop Branch in remote in Sourcetree?

Time:04-22

I have cloned an existing repository and find that only master branch is found in remote but develop branch is not there. When I tried to merge master and /origin/master branch to local develop branch, below errors pop up. How can I fix the error and create the /origin/develop branch? Thanks

git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks push -v --tags --set-upstream origin develop:develop
Pushing to 'GOT folder'
error: refs/heads/develop does not point to a valid object!
error: refs/heads/feature/xxxx does not point to a valid object!
remote: error: refs/heads/develop does not point to a valid object!        
remote: error: refs/heads/feature/xxxx does not point to a valid object!        
remote: fatal: bad object .alternate        
error: refs/heads/develop does not point to a valid object!
error: refs/heads/feature/xxxxx does not point to a valid object!
fatal: bad object .alternate
To 'GOT folder'
 = [up to date]      1.0 -> 1.0
 = [up to date]      1.1 -> 1.1
 = [up to date]      1.2 -> 1.2
 ! [remote rejected] develop -> develop (missing necessary objects)
error: failed to push some refs to ''GIT folder''

CodePudding user response:

As mentioned the develop branch in not on remote.

  • So first create the develop branch on your local repo using

    git checkout -b develop

  • Then pull branch master into this checked out develop branch by using

    git pull origin master

  • Finally push your local develop branch to remote

    git push origin HEAD

  • Related