第一次提交应该包含什么?
我很快就会启动一个 Android 项目来了解 Android,并同时学习 git。
但我很好奇,第一次提交应该是什么?它应该只是应用程序的外壳吗?就像放入应用程序信息的默认文件之类的?也许制作所需的类文件但让它们相对空?
除此之外的大多数项目都有同样的问题。如果我说得太含糊,请告诉我,我会尽力澄清您喜欢的内容。
I'll be starting an Android project soon to learn about Android and will be learning git alongside it.
I was curious though, what should be in the first commit? Should it be just a shell of the application? Like maybe the default files with the app info put in and such? Maybe make the class files that would be required but leaving them relatively empty?
Same questions for most projects other than this. If I'm being too vague let me know and I'll try to clarify whatever you like.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您的第一次提交应该是一些基本结构(即,甚至不填写结构 - 只需提交基本结构)。所有提交都应该是相对较小的更改。这将帮助您跟踪整个过程中的所有更改(特别是如果您在提交信息部分记录每个小提交所涉及的操作/更改)。另外,你永远不想提交一些不起作用的东西......
干杯!
Your first commit should be some basic structure (ie. don't even fill in the structure - just commit the bare-bones). All commits should be relatively small changes. This will help you keep track of all the changes along the way (especially if you document what each small commit involved doing/changing in the commit information section). Also, you never want to commit something that is not working...
Cheers!
大多数情况下,您只是想尽快完成。您希望从项目一开始就使用源代码控制。只需添加并提交您当前拥有的内容即可。目录结构和自述文件/源文件就足够了。
Mostly, you just want to do it as soon as possible. You want to use source control from very beginning of your project. Just add and commit what you currently have. Directory structure and readme/source file is more than enough.
请记住,如果您稍后决定使用
rebase
重写,那么您在第一次提交中放置的任何内容都将遇到困难。我会将基本的自述文件作为您的第一次提交。Keep in mind, that anything you put in the first commit you will have trouble rewriting using
rebase
should you decide to later. I would put a basic README as your first commit.这并不重要,但我的建议是:
首先提交您将使用的空目录结构,也许使用单个源文件和/或构建脚本。尽早提交非常重要,这样您就可以在存储库中拥有完整的历史记录。 (换句话说,在第一次提交之前不要工作一个小时)。
It doens't really matter, but my suggestion would be:
Commit the empty directory structure you will be using first, perhaps with a single source file and/or a build script. It is important that you commit as early as possible, so you have full history in the repository. (In other words, don't work for an hour before making the first commit).