Exclude specific files from 'git pull'

后端 未结 2 511
灰色年华
灰色年华 2020-12-03 04:50

I have a production git repo that I only pull changes from the main repo into; I never change this repo or do commits/pushes from here. I recently accidentally pushed some u

相关标签:
2条回答
  • 2020-12-03 05:02

    This allowed me to tell git to ignore a specific file, even though it was already part of a project. All changes I make to it will be ignored:

    git update-index --assume-unchanged Localization/el-GR.js
    

    Source: http://codethug.com/2013/09/20/4-ways-to-ignore-files-with-git/

    0 讨论(0)
  • 2020-12-03 05:16

    git pull is equivalent (almost) to git fetch && git merge. You just have to invoke fetch and than merge only specific files - tutorial.

    0 讨论(0)
提交回复
热议问题