-3

I am having an issue with pushing to my repository using Git on Github. The error is attached here

What I want to know now is that do I have to create the files as a placeholder on Github before pushing my codes to it. I am really confused.

Thanks.

heywhydot16
  • 15
  • 1
  • 6
  • Please paste the error message as a text in your question, not an image. – Maroun Sep 06 '17 at 09:53
  • Please read the error message. – CodeCaster Sep 06 '17 at 09:53
  • And please read the error message. Your local branch is behind the remote branch. Pull the changes before push your local changes. –  Sep 06 '17 at 09:54
  • @MarounMaroun there error message is much that is why I decided to use the image. Have you been able to load the image? – heywhydot16 Sep 06 '17 at 09:56
  • @CodeCaster I am really new to Git. Please any help? – heywhydot16 Sep 06 '17 at 09:57
  • @Philj0 Ok, thanks I will try that. – heywhydot16 Sep 06 '17 at 09:57
  • Sorry, but we all were new to Git once, that's no excuse for not reading. The error message tells you everything you need to know. – CodeCaster Sep 06 '17 at 09:57
  • The error message is in text. Please be courteous and post the text of error messages instead of screenshots. Also if you read the error message while posting it you will see it suggest doing a `git pull` first to bring down changes on github you don't have locally before doing a push. Have you tried following that suggestion? – Jon Hanna Sep 06 '17 at 10:01
  • Possible duplicate of [Cannot push to GitHub - keeps saying need merge](https://stackoverflow.com/questions/10298291/cannot-push-to-github-keeps-saying-need-merge) – phd Sep 06 '17 at 16:17

2 Answers2

0

Your error message clearly states that you have pull the changes locally to your machine by using the command git pull then you can push

PS. if you pull the changes and the push right away you will be pushing the same thing that you pull so you will be prompt with a error.

You need to commit what you have done before merging.

So commit and then pull.

git add foo.js
git commit foo.js -m "commit"
git pull
git push
AutoTester213
  • 2,714
  • 2
  • 24
  • 48
-1

No, you don't need to create the files as a placeholder on Github before pushing your code to it.

Francesco
  • 4,052
  • 2
  • 21
  • 29