VSTS: Error encountered while pushing to the remote repository: Not a valid reference 'origin/development'
Solution 1
Try right-click on my local branch in Visual Studio under "Branches" in Team Explorer and do a Push, this is where it fails. If I go to "Sync" and do a Push under Outgoing Commits, it works fine.
Solution 2
The same thing happened to me and I resolved it by going to my Repository Settings in Team Explorer > Settings and updating the settings under "Remotes". Origin was set incorrectly to a local git instance.
Comments
-
mal-wan almost 2 years
Edit - This issue seems to have (at least temporarily) resolved itself - I have no idea why and I have not changed anything to make it work - I'll update if it breaks again
I used Git-TF (https://gittf.codeplex.com/) to move our existing Team Foundation Version Control repo to a new Git repo (both repos in the same VSTS Project).
It all appeared to work correctly. However now we have lots of issues.
- Trying to push changes from a local branch to a remote branch gets the following error:
Error encountered while pushing to the remote repository: Not a valid reference 'origin/development'
- Using the Sync command, however, does work and pushes changes successfully to remote.
- Perhaps the biggest problem - we've only be able to get a Pull Request to work once. Now every Pull Request is throwing
405 error
for everything we try to do (abandon / accept - it all throws the same 405 Error)
Edit: Steps Taken to setup the Git repo
- Downloaded and installed Git and Git-tf on my local machine
- Cloned the TFVC repo locally via git-tf
- Created a new Git Repo via VSTS
- Set the new repo as remote on my local machine
- Pushed the full history to the Git Repo
Steps taken once the Git repo was established
- Created a development branch from the master
- Checked the development branch out locally via Vis Studio
- Created a new local branch from the local development branch
- Made changes and a few commits
- Publish the local branch to remotes
- Click on "Create a Pull Request" from Vis Studio
- Local Source Branch: test-branch, Remote target: development - then click Create
- No Merge Conflicts, I review my own work and Accept - so far so good
- Click on Complete Pull Request, leave "delete branch after merge" selected and click Complete Merge
- And this time it's worked...infuriatingly... The last 2 days it hasn't worked...
Back to square one until I can repeat the process it seems.
-
ahjashish over 4 yearsStill having this issue. Wonder if they'll ever fix it.