问题描述
我对git很陌生。我目前正试图通过使用它来跟踪一些Excel文件中的变化,我正在跟踪一些我参与的连续活动。所有文件都在一个存储库中。我想用他们的版本分别标记每个文件。这可能吗?到目前为止,我发现了标记整个存储库的能力。如果我想要做的是错误的,请告知我最佳做法。
预先致谢。
当我这样做时,我故意删除了一个以前的标签,以便整个存储库都被标记(因为我没有找到标记单个文件的方式)为v1.0。因为我现在想用文件名重新设置标签的名称,并且很容易理解事情的发生方式,我该如何回滚删除并重命名之前的标签(已删除的标签)?
标签放置在特定的提交中,而不是整个存储库。
做你所建议的一种方法是确保你只对每个提交提交了一个文件的修改,然后你可以用eg来标记该提交。 file1-v1.0
代表file1的v1.0。
你想通过标记这些来表示什么提交虽然?这将影响任何有关如何改善流程的建议。
I am very new to git. I am currently trying to get familiarized with it by using it to track changes in some excel files that I am maintaining to track some continuous activity I am involved with. All the files are in a single repository. I want to tag each file separately with their versions. Is this possible? So far what I found was the capability to tag the entire repository. If what I am trying to do is wrong, do advise me on the best practice.
Thanks in advance.
Edit
When I was doing this I deliberately deleted a previous tag to make the entire repository be tagged( as I did not find a way to tag single files) as v1.0. As I now want to reset the name of the tag with the file name and quite comfortable with the way things should happen, how can I rollback the deletion and rename the previous tag (the deleted tag)?
Tags are placed on specific commits as opposed to the repository as a whole as you suggest in your question.
One way of doing what you are suggesting is making sure you only commit changes to a single file with each commit, then you can tag that commit with eg. file1-v1.0
to represent v1.0 of file1.
What are you trying to represent by tagging these commits though? That will influence any advice on how to better your process.
这篇关于如何在GIT中标记单个文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!