Skip to content

git diff not working using jupyter lab git ui #1435

@niannianli2026

Description

@niannianli2026

when using git ui on jupyter lab, and check git diff, the ui is not showing the real difference:
tested by aws support team too and confirmed the issue exists, thus was advised to raise the issue here, details as below:

Case 1:
1, open sagemaker notebook instance
2, open any github repo within
3, make a change to any file
4, when you go to git ui, right click on the changed file, click "Diff this file", you can see exact changes shown, e.g., open the attached screenshot "git ui diff normal", you can see the changes are shown
5, repeat same steps as above, but this time make changes to your .gitignore file, the changes are not shown at all on git ui, e.g.,open the attached "git ui diff wrong", you can see the changes are NOT shown
kindly support, thanks

Attachments
git ui diff wrong.png
git ui diff normal.png

Case 2:

  1. Local environment at localhost:8888 (non-SageMaker instance)
  2. JupyterLab with jupyterlab-git extension
  3. Verified the .gitignore diff display issue

Here are my detailed reproduction steps:

  1. Setting up JupyterLab environment:
pip install jupyterlab
pip install jupyterlab-git
  1. Creating and modifying a .gitignore file:
echo "*.log" >> .gitignore
git add .gitignore
git commit -m "Initial commit"

echo "*.tmp" >> .gitignore

Output:

Reinitialized existing Git repository in /Users/*******/Desktop/program/workshop/.git/
[main (root-commit) 0acf455] Initial commit
1 file changed, 3 insertions(+)
create mode 100644 .gitignore
  1. I've attached screenshots showing the results of these steps.
    Attachments
    TestResult_UIBug.png
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions