I have fork a repo and pull:
git pull origin master
I add some files and made some changes and I want to push my changes to my fork:
git add -A
git commit -m "some changes"
git push
But I got this error:
fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin master
I tried to set the origin:
git push origin master
But I got this error:
error: src refspec develop does not match any.
error: failed to push some refs to 'https://github.com/meme/forkRepo.git'
I fixed with this:
git checkout master
and finally I made a push:
git push
Everything up-to-date
But I went to GitHub and check my fork repo in the browser but the files I add and the files changes are not not showing. Any of you knows where did my changes went?, I still can see the files and my changes on my computer.
I really appreciate you help
The issue is the current branch doesn't exist in upstream for some reason. Notice in the error message it tells you exactly what to use, but you missed the --set-upstream
flag.
But I got this error:
fatal: The current branch master has no upstream branch. To push the current branch and set the remote as upstream, use
git push --set-upstream origin master I tried to set the origin:
git push origin master
Do
git push --set-upstream origin master