0

I have NO idea what I am doing with git. I started a project in vs code. I then decided after, that I would like to upload it to github to attempt to make my site live.

I went through the instructions for git bash and uploading a project to github.

I am now getting these errors: " ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'https://github.com/eddiepearson/layout-testing.git' 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. "

I have NO clue what to do or what I am doing at this point. I see .git in my project folder, but nothing is live in github other than a Readme.

eddiepearson
  • 31
  • 1
  • 7
  • 1
    Did you do what the message says? Read any of the hundreds of SO questions and other blog posts, articles and tutorials mentioning that error message? – jonrsharpe Mar 24 '19 at 22:09
  • I did in fact and I didn't see anything that mentioned that after putting "git pull" it says "There is no tracking information for the current branch. Please specify which branch you want to merge with." Seeing as how I am brand new to all of this, I'm not quite sure how or what I am supposed to write here. – eddiepearson Mar 25 '19 at 13:03

1 Answers1

0

Just look at what git hints :

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

So you would have to type

git pull

to get the first commit which is on the remote (just the README.md)

It will be merged with your local master and you'll be ready to push.


However, not to be pedantic or anything, but I'd honestly advise for a useful trip near the git wiki page here for example, it's a good start to search for resources on the subject. You won't need to master every advanced aspect of git to benefit from it, just read enough to understand the basics.

Romain Valeri
  • 19,645
  • 3
  • 36
  • 61
  • OK, I [now](https://meta.stackoverflow.com/questions/381754/how-ok-is-it-to-post-an-answer-on-a-maybe-duplicate-question) get that I probably should *not* have answered this. Sorry for the noise ^^' – Romain Valeri Mar 24 '19 at 23:27
  • all good! Thanks for your input. I do "git pull" and it says "There is no tracking information for the current branch. Please specify which branch you want to merge with." Is there a specific way to type this in? – eddiepearson Mar 25 '19 at 13:01
  • @eddiepearson Yeay, sorry, I wrongfully assumed that your remote was already set, in which case the default pull source kicks in from config. If *not*, you'll have to set it with `git remote add` (check your github for the url to use). – Romain Valeri Mar 25 '19 at 13:04