0

I made some changes to a project on Github from my home computer yesterday. Now I've just made some new changes on the same project, from my work computer.

I tried to commit and push with git push but git said:

error: failed to push some refs to 'https://github.com/...'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. If you did not intend to push that branch, you may want to
hint: specify branches to push or set the 'push.default' configuration variable
hint: to 'simple', 'current' or 'upstream' to push only the current branch.

So I had to use the following command:

git push --set-upstream origin BEHST;

The push went alright but I cannot see my changes on my Github webpage.

Does anyone know why?

How can I propagate my git changes to my Github webpage?

vanogrid
  • 402
  • 1
  • 9
  • 14
DavideChicco.it
  • 3,318
  • 13
  • 56
  • 84
  • Just to confirm, are you viewing the correct branch on GitHub? It defaults to the "default" branch, which is usually `master`. – roryrjb Jun 27 '17 at 15:06
  • It looks like you pushed to a branch. You can use the "branch" drop down on GitHub to look for BEHST. If you want it in the "master" branch, you can either do a pull request in GitHub or manually [merge](https://git-scm.com/docs/git-merge) it yourself. – vcsjones Jun 27 '17 at 15:10
  • @roryrjb I'm on a branch – DavideChicco.it Jun 27 '17 at 15:27

1 Answers1

0

Have you updated your project's code before pushing?

You need git pull origin master before you push anything.

I think you are using origin as a name for your remote.

You need to pull before push, to make your local repository up-to-date before you push something. This helps in resolving conflicts locally.

Shaig Khaligli
  • 4,955
  • 5
  • 22
  • 32
  • I tried but it says `Pull is not possible because you have unmerged files. Please, fix them up in the work tree, and then use 'git add/rm ' as appropriate to mark resolution, or use 'git commit -a'.` – DavideChicco.it Jun 27 '17 at 15:34
  • then this will help you: https://stackoverflow.com/questions/26376832/why-does-git-say-pull-is-not-possible-because-you-have-unmerged-files – Shaig Khaligli Jun 27 '17 at 16:22