How to make change to .gitattributes take effect

后端 未结 3 1787
挽巷
挽巷 2020-12-31 04:43

I\'m working on a project where we have recently started using git. The setup was not perfect from start, so I\'ve set up .gitattributes after people started cloning/working

3条回答
  •  生来不讨喜
    2020-12-31 05:14

    You don't have to reset hard (if I understand correctly what you're doing).

    My case is similiar. I added a .gitattributes in a running project. I need the files I have and the files in online repo to be ruled by gitattr.

    # This will force git to recheck and "reapply" gitattributes changes.
    git rm --cached -r .
    git add -A
    

    Your commit will re-add all the .ending files you mention and you'll not lose any changes you may have. Of course, Bob will have to pull to get it.

提交回复
热议问题