简体   繁体   中英

Is there any way to only ignore change to a checked in file in git locally?

There is a setup config file for our team project. I'm the only one who use different editor than other member, so I would need to edit the class path in that file just for myself.

Is there anyway to ignore the change to this file locally? ie not using .gitignore. I tried to add it to .git/info/exclude but the change still shows up when I try to stage and commit.

There's just one line change I want to keep in the file.

git update-index --skip-worktree -- <filepath>

The changes to this file will not be detected or added or committed.

To cancel the effect:

git update-index --no-skip-worktree -- <filepath>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM