English 中文(简体)
pull 时重写的 gitignore 文件
原标题:gitignore file rewritten on pull
  • 时间:2012-05-23 06:14:16
  •  标签:
  • git

步骤:

  • 在基本配置的 repo 中有一个文件

  • 检出回购

  • 将文件放入. gitignore

  • 修改文件

  • Git 状态, 仍然在那里, 所以我做了一个假设 - 改变

  • 不再处于 Git 状态

  • 做了一些开发工作, 并提取了别人的代码( 被放出的文件与此文件无关) )

  • . gitignore 中的文件以某种方式被重新写回初始内容!

有人知道为什么和如何绕过这一切吗?

我不想在远程或本地视图中删除文件。 我只是要断开它们。 它们不是 Git 状态, 也不是 git 日志, 所以我不知道为什么它会返回。 还没有使用分支, 只是这里有主控文件 。

问题回答

Git 无法轻而易举地解决这个问题。 .gitignore 对跟踪文件无效, 只对未跟踪的文件有效 。

所以假设不改变是避免它脱离Git状态的唯一方法, 但是当尝试退出其它分支或合并回溯变化时, 这会引起问题, 因为Git通常不会覆盖未承诺的更改 。

它恢复了变化不是正常的瞬间行为。所以如果你提供结束会话的笔录,那将大有帮助。





相关问题
git confusion - cloning a repo is returning a past version

Im having some confusion with my git usage. I cloned a repo from one comp to the other, and the new clone is the state of the original that was active some time ago. So its cloning a past version. ...

Appropriate strategy for tagging and hotfixing with git

I was wondering if the strategy I m using for tagging and hotfixing tags (which then I use for deploying rails applications) with git is appropriate. For tagging I just tag a commit of the master ...

Tips on upgrading CVS to git/hg?

We still use CVS, I use git and hg for my personal use though I m still a novice at both, but I realize they re much more modern and better, faster, distributed, etc. It s just everyone is so ...

Using Git in a TFS shop

Using Git at home has spoiled me - I now find using TFS at work to be a bit of a drag and want to explore the possibility of using Git locally and syncing somehow with TFS. I figure there are a few ...

热门标签