Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

Git compare commits

2021-12-01
2021-12-01
  • kristiankroier - 2021-12-01

    Has anyone figured out how to compare two "random" commits in Git?
    E.g. master before a branch and the fifth commit on the branch. Going through each commit one at a time is slow and basically impossible to do with a complete overview.

     
  • i-campbell

    i-campbell - 2021-12-01

    I know that compare two arbitrary commits and compare two arbitrary branches are on the roadmap.

    I have been using this to compare to an old branch, but you are right it is cumbersome. Essentially, you create another .library or .project file of the old commit to compare to:

    1. If the commit is not on a branch head, use Git for Windows to create a branch at the old commit. (To do this in CODESYS Git is also on the roadmap)
    2. In CODESYS Git Branches View, press the refresh button, then checkout the new branch which is at the old commit.
    3. Save As old-commit.library, then Git disconnect (without deleting the local repo!).
    4. Reopen the original .library, checkout the head branch again, and use Project > Compare... to compare against the old-commit.library
     
  • kristiankroier - 2021-12-01

    Thanks for the input. I was afraid what you described was the way to do it at the moment. At least improvements are coming because the current git implementation is in some cases worse than just using the binary files and an external VCS.

     

Log in to post a comment.