giteclipsegitlabegit

Why does Eclipse show "Push HEAD" button after I did "Commit and Push" (to small Gitlab)


We have a small Gitlab setup for one of our development environments, and I am using Eclipse and when I make changes to a file, I move the file from Unstaged changes to Staged Changes and add a Commit Message.

Eclipse has 2 buttons, "Commit and Push" and "Commit", and I've been pressing the "Commit and Push" button and then Eclipse shows the popup for success, but Eclipse then shows a "Push HEAD" button, and from what I can tell the updated file is making it into Gitlab successfully.

Why is Eclipse showing the "Push HEAD" button, and, also, should I/do I need to push the "Push HEAD" button?

Thanks, Jim


Solution

  • To be precise, the button is not called Push HEAD, but Push HEAD..., and the suffix ... indicates that pressing the button does not directly execute a command but opens a dialog that provides options like e.g. for force pushing or for pushing your local HEAD to a new remote.

    In your case, with a single upstream remote, you only need Push HEAD... to do a force push (when doing Commit and Push, only the commit may succeed, but the push may be rejected by the server, e.g. with the reason non-fast-forward) or if you want to push your local commits that you have not already pushed individually via Commit and Push, e.g. when working offline or when you did a revert commit (in the History view you can right-click a commit and choose Revert Commit which creates locally an inverse commit which you then want to push via Push HEAD...).