Webstorm push rejected

Answered

When I try to share the following project to Github, it commits it, but does not push it. Instead it says that the push is rejected. Why? See the screenshot below:

 



0
15 comments

Check the EventLog and Console tab of the VersionControl tool window to see more details on why it is rejected.

0

Assuming that terminal equals to console there is not much more information in either window. Please check the screenshot below:

 

0

> Assuming that terminal equals to console

No, in the Version control tool window there is a separate tab called Console, that shows git commands and outputs.

You could also check the logs https://intellij-support.jetbrains.com/hc/en-us/articles/207241085

3

Nope. Cant find it. Please see the screenshot below:

 

0

Misha,

Console tab will appear after commit/push action.

 

0

Found it finally! Here is what it gives me:

19:44:48.231: [VCS Template] git -c core.quotepath=false -c log.showSignature=false push --progress --porcelain Webstorm-Project-Template refs/heads/master:master --set-upstream --follow-tags
To https://github.com/GroxTheProgrammer/Webstorm-Project-Template
error: failed to push some refs to 'https://github.com/GroxTheProgrammer/Webstorm-Project-Template'
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
! refs/heads/master:refs/heads/master [rejected] (fetch first)
hint: (e.g., 'git pull ...') before pushing again.
Done
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

0

Mihail,

Does the hint help?

 

0

When I try to do git pull, it does not work, which I think was the whole point of the hint. Also please this Toolbox issue I am having: https://intellij-support.jetbrains.com/hc/en-us/community/posts/360000573490-JetBrains-Toolbox-JavaScript-Error-Type-Error-Cannot-read-property-update-scroll-of-null

0

> When I try to do git pull, it does not work

Please clarify. What exact error do you get?

0

I get this error:


14:36:22.064: [VCS Template] git -c core.quotepath=false -c log.showSignature=false pull --progress --no-stat -v --progress Webstorm-Project-Template master
POST git-upload-pack (425 bytes)
remote: Counting objects: 3, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
warning: no common commits
From https://github.com/GroxTheProgrammer/Webstorm-Project-Template
* branch master -> FETCH_HEAD
* [new branch] master -> Webstorm-Project-Template/master
fatal: refusing to merge unrelated histories

0

You are trying to pull from a repository that is not related to your local one. See https://stackoverflow.com/questions/37937984/git-refusing-to-merge-unrelated-histories-on-rebase

0
Avatar
Permanently deleted user

I was merging the same thing. So it cannot be unrelated.

0

It is git itself telling you histories are unrelated, not IDE. You will get exactly the same if you execute the git -c core.quotepath=false -c log.showSignature=false pull --progress --no-stat -v --progress Webstorm-Project-Template master command manually.

The issue is that all commits in the remote repository have different hashes from your local repo - so there are no common commits between the two and git considers then as unrelated. It could be a result of rebasing actually.

See e.g. https://stackoverflow.com/questions/37937984/git-refusing-to-merge-unrelated-histories-on-rebase

 

0

feature request: can the "bubble" that displays currently "Push Rejected, Push <branch> to origin/<branch> was rejected by..." either display the error message or at least the "link" to open Version Control > Console ?

0

Please sign in to leave a comment.