如何使用 Git 跟踪 .txt 文件?
当我写入 .txt 文件时,如何跟踪更改?这将从文件的创建到我完成它为止。该文件是否需要位于某个位置?需要特殊命令吗?我以前从未使用过开源管理软件,因此欢迎您提供宝贵的建议。
As I write in a .txt file, how do I keep track of the changes? This will be from the creation of the file until I'm finished with it. Does the file need to be in a certain place? Special commands required? I have never used open source management software before, so as much advice as you have to spare would be welcome.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我建议阅读Git Book。
您必须
初始化您的存储库
创建并添加文件
提交更改
每当您对文件进行更改并希望将其添加到存储库时,请重复步骤 2 和 3。
但是:您确实必须先阅读教程并熟悉基本命令。您不必在某个位置创建 git 存储库,任何文件夹都可以。
I suggest to read the Git Book then.
You have to
Initialize your repository
Create and add files
Commit changes
Repeat steps 2 and 3 whenever you make changes to your file(s) and want to add them to your repository.
But: You really have to read a tutorial before and get familiar with the basic commands. You don't have to create a git repository at a certain place, any folder will do.
您只需创建一个存储库并将文件添加到其中即可。
可以在这里找到一个简单的命令列表。
在仅包含文本文件的空目录中,您要做的就是类似以下内容:
然后,每次您想要提交/保存当前更改或文件的当前版本时,请键入:
或(添加提交消息稍后可以在提交/版本历史记录中看到)
You just have to create a repository and add the file to it.
A simple command list can be found here.
All you'd do would be something like the following in an empty directory containing your text file only:
Then, every time you'd like to commit/save current changes or the current version of the file, type:
or (to add a commit message that can be seen in the commit/version history later on)