infotechelg
asked on
Visual Studio - Git Branching Error
I'm new to, and using Git. I have my remotes/origin branch of "master" that contains all production-ready code.
From "master", I create a new local branch called "Bug Fixes".
When I try to push code changes in Bug Fixes back to "master", I get this error every time:
Error encountered while pushing to the remote repository: Not a valid reference 'origin/master'
Maybe I'm not using this correctly? Can someone please advise?
From "master", I create a new local branch called "Bug Fixes".
When I try to push code changes in Bug Fixes back to "master", I get this error every time:
Error encountered while pushing to the remote repository: Not a valid reference 'origin/master'
Maybe I'm not using this correctly? Can someone please advise?
ASKER
Ferruccio,
Thank you for the reply.
I'm using Visual Studio to do all my commits, pushes, syncs. I'm sorry, I should have mentioned that originally.
But yes, all my changes are committed.
Thank you for the reply.
I'm using Visual Studio to do all my commits, pushes, syncs. I'm sorry, I should have mentioned that originally.
But yes, all my changes are committed.
ASKER
I should also point out that if I 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.
You cannot push from one branch to another branch. You have to switch to master branch and then merge the Bug Fixes branch.
ASKER
Awesome! I'll give that a shot.
ASKER
Pepr,
Let me ask you this. What is the point, then, of having a "Push" option if you can't push changes from your local branch back to the server branch from where the local branch originated? Seems kind of counter-intuitive. What is "push" for, then?
Let me ask you this. What is the point, then, of having a "Push" option if you can't push changes from your local branch back to the server branch from where the local branch originated? Seems kind of counter-intuitive. What is "push" for, then?
ASKER
Pepr,
So, I tried as you suggested. I cannot do as you suggested. I cannot make branches in "remotes/origin" active in order to do a "merge from". I can only merge from remotes/origin into my local branch.
What you suggest works locally. But my problem is pushing the local changes back into the master, remote branch.
So, I tried as you suggested. I cannot do as you suggested. I cannot make branches in "remotes/origin" active in order to do a "merge from". I can only merge from remotes/origin into my local branch.
What you suggest works locally. But my problem is pushing the local changes back into the master, remote branch.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you so much for the detailed explanation! A huge help.
I should also point out that if I 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.
This is also happening to me!
It is again a stupid bug on the part of Git extension for Visual Studio. Thank you for suggestion that I can make the push happen under Sync-Push command flow
This is also happening to me!
It is again a stupid bug on the part of Git extension for Visual Studio. Thank you for suggestion that I can make the push happen under Sync-Push command flow
Open in new window