I saw many issues in this context, and tried the solutions provided there but do not work for me for some reason.
So I created an empty project and initialized it using git init
(documentation).
git remote -v
gives me this:
origin https://path_to_/my_project.git (fetch)
origin https://path_to_/my_project.git (push)
When I run git pull
I get this error:
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.
git pull <remote> <branch>
If you wish to set tracking information for this branch you can do so with:
git branch --set-upstream-to=origin/<branch> master
When I run git push origin master I get this error:
error: failed to push some refs to
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
When I run git push -f origin master
(as suggested in many solutions I saw), I get this error:
error: src refspec master does not match any.
error: failed to push some refs to 'https://path_to/my_project.git'
Additional info: git branch -r
gives me this:
origin/master
What info should I check to fix this?