1

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?

kowsky
  • 12,647
  • 2
  • 28
  • 41
Billal Begueradj
  • 20,717
  • 43
  • 112
  • 130
  • Possible duplicate of [Updates were rejected because the tip of your current branch is behind](https://stackoverflow.com/questions/39399804/updates-were-rejected-because-the-tip-of-your-current-branch-is-behind) – phd Sep 05 '18 at 13:35

1 Answers1

2

Set the remote branch as upstream of your local branch:

git branch -u origin/master

Then pull

git pull
blue112
  • 52,634
  • 3
  • 45
  • 54