0

I am trying add my ionic project to my git account. I am getting rejected message the way in which I am trying.

I have tried like it is described in the following article.

https://www.joshmorony.com/how-to-use-git-with-ionic-2-projects/

This is the error I am getting

Ratikanta
  • 307
  • 6
  • 16
  • This is more of a general Git issue than an Ionic one. [This question and its accepted answer](https://stackoverflow.com/a/37938036/7468384) might help you. – Gabriel Lovetro Jul 31 '17 at 13:30
  • 1
    My friend it is better to post the error as text instead of a screenshot because it will be easier to search by other community members, and easier to read. – George Jul 31 '17 at 13:36
  • @George Will do it from next time, did not get the same error again – Ratikanta Jul 31 '17 at 17:34

1 Answers1

0

As the error says:

git: updates were rejected because the remote contains work that you do not have locally

this means that the remote branch have changes that you did not pull into your local branch. git fetch && git pull will replace your local branch with the content of the remote branch, then you can do changes to your local branch and then push them back to the remote branch.

this answer could help you as well

George
  • 716
  • 1
  • 12
  • 29
  • Seems like there's more to it than that - notice how near the end he does try to do a git pull and it says "refusing to merge unrelated histories". – Gabriel Lovetro Aug 01 '17 at 13:52