I can't push my repo to bitbucket. Error of "failed to push refs"
I checked error: failed to push some refs but the answer there doesn't apply to me, as it speaks of 777 permissions and i'm on windows.
I have used bitbucket and git before some years back. And there have been some changes in the GUI of the bitbucket website. It used to be that when I created a repo in bitbucket, then bitbucket would give a few commands that I could paste in like git remote origin... and some URL.. (I would use the word bitbucket instead of origin). But bitbucket's design has changed and I can't see those commands now and I can't get it to work.
(Following a suggestion I saw in a youtube video), to find the line to add the git "remote", I went to the clone option in the GUI, and without doing any clone, I got the URL of https://[email protected]/gbatha12/reminderonlaptopdownstairs.git
And then I did git remote add bitbucket https://[email protected]/gbatha12/reminderonlaptopdownstairs.git
As you see below.
C:\Users\User\source\repos\RemindProj\RemindProj>git init Initialized empty Git repository in C:/Users/User/source/repos/RemindProj/RemindProj/.git/ C:\Users\User\source\repos\RemindProj\RemindProj>git add -A C:\Users\User\source\repos\RemindProj\RemindProj>git push bitbucket master error: src refspec master does not match any error: failed to push some refs to 'bitbucket' (ok that's understandable I have to create a commit) C:\Users\User\source\repos\RemindProg\RemindProg>git commit -m "earlyversion" [master (root-commit) c8b3dc1] earlyversion 25 files changed, 596 insertions(+) create mode 100644 App.config create mode 100644 Form1.Designer.cs create mode 100644 Form1.cs create mode 100644 Form1.resx create mode 100644 Program.cs create mode 100644 Properties/AssemblyInfo.cs create mode 100644 Properties/Resources.Designer.cs create mode 100644 Properties/Resources.resx create mode 100644 Properties/Settings.Designer.cs create mode 100644 Properties/Settings.settings create mode 100644 RemindProj.csproj create mode 100644 bin/Debug/RemindProg.exe create mode 100644 bin/Debug/RemindProg.exe.config create mode 100644 bin/Debug/RemindProg.pdb create mode 100644 obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs create mode 100644 obj/Debug/DesignTimeResolveAssemblyReferences.cache create mode 100644 obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache create mode 100644 obj/Debug/RemindProg.Form1.resources C:\Users\User\source\repos\RemindProj\RemindProj>git push bitbucket master fatal: 'bitbucket' does not appear to be a git repository fatal: Could not read from remote repository. create mode 100644 obj/Debug/RemindProg.Properties.Resources.resources create mode 100644 obj/Debug/RemindProg.csproj.CoreCompileInputs.cache create mode 100644 obj/Debug/RemindProg.csproj.FileListAbsolute.txt create mode 100644 obj/Debug/RemindProg.csproj.GenerateResource.cache create mode 100644 obj/Debug/RemindProg.csprojAssemblyReference.cache create mode 100644 obj/Debug/RemindProg.exe create mode 100644 obj/Debug/RemindProg.pdb Please make sure you have the correct access rights and the repository exists. OK that's understandable I have to add the git "remote". C:\Users\User\source\repos\RemindProg\RemindProg>git remote add bitbucket https://[email protected]/gbatha12/reminderonlaptopdownst airs.git C:\Users\User\source\repos\RemindProg\RemindProg>git push bitbucket master To https://bitbucket.org/gbatha12/reminderonlaptopdownstairs.git ! [rejected] master -> master (fetch first) error: failed to push some refs to 'https://bitbucket.org/gbatha12/reminderonlaptopdownstairs.git' hint: Updates were rejected because the remote contains work that you do hint: not have locally. This is usually caused by another repository pushing hint: to the same ref. You may want to first integrate the remote changes hint: (e.g., 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details. C:\Users\User\source\repos\RemindProg\RemindProg> So the message says "the remote contains work that you do not have locally."
But if I look at the repo on the bitbucket website, I just see a .gitignore file.
I tried deleting that .gitignore file that exists on the remote site but not locally.
And then doing git push bitbucket master but same error.
I know the error message, suggests to do a git pull, though i'm a bit reluctant to because my local area has some early version of my program. Normally when I do a pull it's when I have no program locally. And anyhow I never had this error in the past when using git and bitbucket.