Remove a file from a Git repository without deleting it from the local filesystem

后端 未结 11 2014
陌清茗
陌清茗 2020-11-22 02:25

My initial commit contained some log files. I\'ve added *log to my .gitignore, and now I want to remove the log files from my repository.



        
11条回答
  •  隐瞒了意图╮
    2020-11-22 02:58

    If you want to just untrack a file and not delete from local and remote repo then use thhis command:

    git update-index --assume-unchanged  file_name_with_path
    

提交回复
热议问题