如何强制“ git pull”覆盖本地文件? - How do I force “git pull” to overwrite local files?

问题:

How do I force an overwrite of local files on a git pull ? 如何在git pull上强制覆盖本地文件? git

The scenario is following: 该场景以下: web

  • A team member is modifying the templates for a website we are working on 团队成员正在修改咱们正在工做的网站的模板
  • They are adding some images to the images directory (but forgets to add them under source control) 他们正在将一些图像添加到图像目录(可是忘记在源代码控制下添加它们)
  • They are sending the images by mail, later, to me 他们经过邮件将图像发送给我
  • I'm adding the images under the source control and pushing them to GitHub together with other changes 我将图像添加到源代码管理下,并将其与其余更改一块儿推送到GitHub
  • They cannot pull updates from GitHub because Git doesn't want to overwrite their files. 他们没法从GitHub提取更新,由于Git不想覆盖其文件。

This is the error I'm getting: 这是我获得的错误: 服务器

error: Untracked working tree file 'public/images/icon.gif' would be overwritten by merge 错误:未跟踪的工做树文件“ public / images / icon.gif”将被合并覆盖 网站

How do I force Git to overwrite them? 如何强制Git覆盖它们? The person is a designer - usually I resolve all the conflicts by hand, so the server has the most recent version that they just needs to update on their computer. 这我的是设计师-一般我会手工解决全部冲突,所以服务器具备他们只需在计算机上更新的最新版本。 spa


解决方案:

参考一: https://stackoom.com/question/4ium/如何强制-git-pull-覆盖本地文件
参考二: https://oldbug.net/q/4ium/How-do-I-force-git-pull-to-overwrite-local-files
相关文章
相关标签/搜索