-2

So my files are uploaded onto the git-GUI. Pressing commit works fine. The push button is clicked and it ask for my destination repository, so I put https://github.com/myusername/reposistoryname and then press enter, afterwards it asks for my username and password. After those items had been entered in, I get this error message.

Pushing to https://github.com/myusername/reposistoryname
To https://github.com/myusername/reposistoryname
! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'https://github.com/emaoll/pnz'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

I have a github account as well as a repository on github.

worker
  • 33
  • 3
  • 13

2 Answers2

0

You got it written... Commit your changes and then pull data. After successful pull you can push your data again.

0

You need to integrate the changes in the remote brance (just like the message said), if you want to bring the changes and look it, you have to use..

git fetch origin //Bring all the changes from the remote server

But, you want to push your local changes, then you must have to use...

git pull //Fetch down new data  from remote server

after that, you can use normally the 'git push' command. Actually you can use also...

git status //This command bring to you some help, about what's next.

I recommended to you, that use (write those commands) Git Bash (command line), - to me- it's more easy. Or if you want, use Git-GUI, just go to Remote Menu > Fetch

Regards!

Moises Gonzaga
  • 151
  • 1
  • 17