Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore ipynb changes in git when using md files #251

Closed
himat opened this issue Jun 10, 2019 · 1 comment
Closed

Ignore ipynb changes in git when using md files #251

himat opened this issue Jun 10, 2019 · 1 comment

Comments

@himat
Copy link

himat commented Jun 10, 2019

I want to use jupytext with a paired .md file, but I also want to commit the original .ipynb files as well for online viewing.
But, since the .md files will be all that's necessary to look at in a diff in git, I just want to ignore any diffs to the .ipynb files and just automatically include them in the commit. Is it possible to do this?

The point is that when I do a git diff, I just want to see the diffs for the .md files and not any lines for the .ipynb files. Is there a git option that lets me automatically force push certain file types (.ipynb in this case)?

@mwouts
Copy link
Owner

mwouts commented Jun 11, 2019

Hello @himat , this is an interesting question.

Based on that stackoverflow question, I think you could use

git diff -- . ':(exclude)*.ipynb'

(replace single quotes with double ones if you're using Windows).

Also, if you want to always exclude ipynb from git diff, there is this gits:

  1. create a nodiff command: git config diff.nodiff.command /usr/bin/true --global (maybe we need something different in Windows)
  2. add a line *.ipynb diff=nodiff to .git/info/attributes

Could you please confirm which method works for you (on which OS)? Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants