As I'm a new user to git. Can someone please help me out and explain the error shown in the picture picture
Asked
Active
Viewed 105 times
-4
-
Do a git pull, then merge the code as needed if it didn't auto merge. Then you'd be able to push the code. I had some trouble remembering the steps when I started working with git, these steps made it easier: git add -> git commit -> git pull -> git push. Hope this helps! – mahmoudayoub Jun 18 '20 at 19:22
-
1Does this answer your question? [How to resolve git error: "Updates were rejected because the tip of your current branch is behind"](https://stackoverflow.com/questions/22532943/how-to-resolve-git-error-updates-were-rejected-because-the-tip-of-your-current). Also a simple `git pull` (as already proposed by Git itself in your picture) before your push may already fix the "error". – bsaverino Jun 18 '20 at 19:28
2 Answers
0
The branch that you are working on is too far ahead of the remote branch. You need to pull the remote branch, resolve and conflicts and then you'll be able to push.
Git can be confusing!

J4G
- 211
- 5
- 14
0
It means that there are already changes on the remote branch that are not part of the history of your branch... under this circumstances, git is asking you to bring over those changes into your branch.... that is normally done with pull... or with merge... or with rebase. You can see the situation by running git fetch origin
and then run something like gitk --all
, then you will notice that your branch went in one direction, the remote branch went in a different direction.

eftshift0
- 26,375
- 3
- 36
- 60