“在rush/admin.py 中,LF 将被 CRLF 替换”使用 git 暂存时出错

发布于 2024-12-22 22:12:26 字数 373 浏览 2 评论 0原文

可能的重复:
git 用 CRLF 替换 LF

我有一个 Django 项目,我想合作和工作和我的团队一起做这件事。我对 git 很陌生,想知道如何设置它。

我已经 cd 进入项目目录并执行了“git init”,

但是当我尝试使用“git add .”暂存它时,它给出了错误“LF 将在rush/admin.py 中被 CRLF 替换”。我应该做什么以及我如何继续前进。请帮忙。

谢谢。

Possible Duplicate:
git replacing LF with CRLF

I have a Django project which I would like to collaborate and work on it with my team. I am very new to git and would like to know how to set it up.

I have cd into the project directory and did 'git init'

but when I try staging it with 'git add .', it gives an error 'LF would be replaced by CRLF in crush/admin.py'. What should and I do about it and how do I move forward. Please help.

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

末骤雨初歇 2024-12-29 22:12:26

您收到的具体错误是因为您的行结尾不统一;当您在系统之间切换时,通常会发生这种情况(Windows 和 Linux 使用不同的行结尾)。如果您对此感兴趣,您可以阅读维基百科条目,其中还包括有关制作确保您的条目是统一的。实际上你可以继续这样做,git 将确保你的所有文件都具有相同的换行符组合。

就熟悉 git 而言,这两个链接应该可以满足您所需的一切:

  1. Git对于初学者
  2. git 分支model (虽然我不是 git 的大用户,但这确实帮助我理解了分支应该如何工作)

The specific error you are getting is because your line endings are not uniform; this usually happens when you shift between systems (Windows and Linux use different line endings). If you are interested in this, you can read the wikipedia entry, which also includes options on making sure your entries are uniform. You can actually go ahead with it and git will make sure all your files have the same newline character combination.

As far as familiarity with git, these two links should give you all you need:

  1. Git for beginners
  2. A git branching model (although I am not a big git user, this really helped me understand how branching should work)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文