[sapui5] [git] Avoid using "Amend Change" in git pane of sap Web IDE

Hi,

SAP Web IDE provide a "seem to be useful" function in the git pane: "Amend changes".

This function allows you to amend you current change to the latest commit.
It's quite useful if you make additional small changes after your last commit, which is in the same scope of the commit.

However, that lead to a fatal error if you're working with a remote git repository (like Bitbucket, Github). It would create a conflict betweens commit, which will cause you lots of pain points.

For example, you have 3 commits: A, B, C

A: already pushed to the remote repository.
B: you've just committed. (but not pushed yet)
C: You've made small changes and "ammend changes" to commit B, and changed the commit description.

Then, you want to push all the changes (B & C) to the remote.
Here's you will get the conflict.

Because the commit B itself contains 2 commits with different description, the remote server cannot distinguish between the 2 commits (B &  C). Hence it will request you to solve the conflict.

After you solve the conflict and send the push request again, the remote repository will get the latest change & description from commit C only. You won't see the commit B.

Hence, DO NOT change the description while "amending changes" commit. Normal amend changes would be OK.

Thanks for reading.


---V---

Nhận xét

Bài đăng phổ biến từ blog này

Tại sao lại chụp ảnh theo bố cục 1/3 ?

[sapui5] Best Practice in sapui5 development

Implement Search field with case-INSENSITIVE by SAP UI5