# How can I avoid \`git checkout -b\` marking git LFS files as modified?

**URL:** <https://www.rubin.community/t/how-can-i-avoid-git-checkout-b-marking-git-lfs-files-as-modified/2553>\
**Category:** Data Management\
**Tags:** git-lfs\
**Created:** [January 10, 2018, 3:49pm UTC](https://www.rubin.community/t/how-can-i-avoid-git-checkout-b-marking-git-lfs-files-as-modified/2553 "2018-01-10T15:49:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mwv](https://avatars.discourse-cdn.com/v4/letter/m/e79b87/32.png) [@mwv](https://www.rubin.community/u/mwv)\
**Post date:** [January 10, 2018, 3:49pm UTC](https://www.rubin.community/t/how-can-i-avoid-git-checkout-b-marking-git-lfs-files-as-modified/2553/1 "2018-01-10T15:49:11Z")

</div>

When I `git checkout -b newbranch` from a repository using `git lfs`, suddenly all of my files that were being tracked by LFS are now listed as modified and that they’re going to be converted from LFS to git.

What is the correct thing to use to do a `git checkout -b newbranch` without the LFS tracked files getting marked as modified?

```auto
[wmwv@lsst-dev01 validation_data_decam]$ git lfs status
On branch tickets/DM-13204

Git LFS objects to be committed:

	astrometry_net_data/sdss-dr9-fink-v5b_and_398_0.fits (LFS: 62de588 -> Git: 62de588)
	astrometry_net_data/sdss-dr9-fink-v5b_and_398_1.fits (LFS: ff2de80 -> Git: ff2de80)
	astrometry_net_data/sdss-dr9-fink-v5b_and_398_2.fits (LFS: 1dc85fe -> Git: 1dc85fe)
	data/0176837/bkgd/bkgd-0176837_10.fits (LFS: 5ec3a6c -> Git: 5ec3a6c)
	data/0176837/bkgd/bkgd-0176837_11.fits (LFS: e20e678 -> Git: e20e678)
	data/0176837/bkgd/bkgd-0176837_12.fits (LFS: 02e6364 -> Git: 02e6364)
[...]

```

Specifically this is for `validation_data_decam`. The contents of `.gitattributes` are:

```auto
*.fits filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.fz filter=lfs diff=lfs merge=lfs -text

```

---

<div class="post-metadata">

**Author:** ![mwv](https://avatars.discourse-cdn.com/v4/letter/m/e79b87/32.png) [@mwv](https://www.rubin.community/u/mwv)\
**Post date:** [January 10, 2018, 3:52pm UTC](https://www.rubin.community/t/how-can-i-avoid-git-checkout-b-marking-git-lfs-files-as-modified/2553/2 "2018-01-10T15:52:46Z")

</div>

Solution?

I re-ran `git lfs install`, and then a `git checkout -b` didn’t created this list of modified files?

Is `git lfs install` something I should just re periodically to keep up with `git lfs` updates?

---

<div class="post-metadata">

**Author:** ![jsick](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/jsick/32/672_2.png) [@jsick](https://www.rubin.community/u/jsick)\
**Post date:** [January 10, 2018, 4:22pm UTC](https://www.rubin.community/t/how-can-i-avoid-git-checkout-b-marking-git-lfs-files-as-modified/2553/3 "2018-01-10T16:22:05Z")

</div>

We changed the Git LFS API server on Monday and maybe that tripped something up with older clients. Do you think this could have been it @jmatt / @josh? Do we need to review our minimum [client version](https://developer.lsst.io/tools/git_lfs.html#installing-git-lfs) requirements?

---

<div class="post-metadata">

**Author:** ![josh](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/josh/32/72_2.png) [@josh](https://www.rubin.community/u/josh)\
**Post date:** [January 10, 2018, 4:27pm UTC](https://www.rubin.community/t/how-can-i-avoid-git-checkout-b-marking-git-lfs-files-as-modified/2553/4 "2018-01-10T16:27:31Z")

</div>

@jsick The running git-lfs server code should not have changed.

@mwv Could you provide the `git`/`git-lfs` versions your using? Eg.

```auto
git --version
git-lfs version

```

---

<div class="post-metadata">

**Author:** ![mwv](https://avatars.discourse-cdn.com/v4/letter/m/e79b87/32.png) [@mwv](https://www.rubin.community/u/mwv)\
**Post date:** [January 10, 2018, 4:46pm UTC](https://www.rubin.community/t/how-can-i-avoid-git-checkout-b-marking-git-lfs-files-as-modified/2553/5 "2018-01-10T16:46:21Z")

</div>

```auto
[wmwv@lsst-dev01 ~]$ git --version
git version 1.9.4
[wmwv@lsst-dev01 ~]$ git lfs version
git-lfs/2.3.4 (GitHub; linux amd64; go 1.9.1; git d2f6752f)

```
