I am fairly new to git
yet currently using it to manage our code in a team environment. I had some rebasing issues and I fixed them using
git ch
try this command
$ git push -f -u origin <name of branch>
i.e $ git push -f -u origin master
I had a similar problem and I resolved it with:
git pull origin
It looks, that someone pushed new commits between your last git fetch
and git push
. In this case you need to repeat your steps and rebase my_feature_branch
one more time.
git fetch
git rebase feature/my_feature_branch
git push origin feature/my_feature_branch
After the git fetch
I recommend to examine situation with gitk --all
.
I had this problem! I tried: git fetch + git merge, but dont resolved! I tried: git pull, and also dont resolved
Then I tried this and resolved my problem (is similar of answer of Engineer):
git fetch origin master:tmp
git rebase tmp
git push origin HEAD:master
git branch -D tmp
Here is another solution to resolve this issue
>git pull
>git commit -m "any meaning full message"
>git push
Well I used the advice here and it screwed me as it merged my local code directly to master. .... so take it all with a grain of salt. My coworker said the following helped resolve the issue, needed to repoint my branch.
git branch --set-upstream-to=origin/feature/my-current-branch feature/my-current-branch