Pat*_*ckT 4 version-control fossil
我希望控制目录的版本,我们称之为“项目”,并将化石文件保存在另一个名为“化石”的目录中。我已经成功创建了“project.fsl”存储库,添加了我的项目文件,提交并关闭。我的问题是了解如何采取下一步行动。
这是我所做的,遵循fossilbook建议。
$ cd project
$ fossil new ../fossils/project.fsl
$ fossil open ../fossils/project.fsl
$ fossil add .
$ fossil ci -m "first commit"
$ fossil close project.fsl
Run Code Online (Sandbox Code Playgroud)
现在我已经处理了我的项目,编辑了一些文件,删除了一些文件,创建了一些文件,重命名了一些文件。我想将项目的当前状态添加到存储库中。我怎么做?
根据我在文档中读到的内容,我的印象是我必须先打开存储库,然后添加文件,然后提交。如果我不打开存储库,我会收到Not within an open checkout.消息。但是如果我open化石想用旧文件覆盖我的目录。(如果我从fossils目录中打开,我会得到一个“解压”版本的项目复制到化石目录中,这也不是我想要的)
$ cd project
$ fossil open ../fossils/project.fsl
Run Code Online (Sandbox Code Playgroud)
这里化石想用旧版本覆盖我的项目。我对每一个建议说不。我怀疑open 这不是正确的方法,但如果不是,那是什么?
我想将我的更改添加到存储库,所以现在 project.fsl 是open,我试试这个:
$ fossil add .
ADDED Slides/tmp.tex
$ fossil commit -m "no idea what I'm doing, this will not end well"
would fork. "update" first or use --allow-fork.
$ fossil close
there are unsaved changes in the current checkout
Run Code Online (Sandbox Code Playgroud)
此时,我删除了所有命名的隐藏文件并重.fslckout .fossil试,结果同样令人失望。
坦率地说,我唯一的兴趣fossil是保留我的项目的历史。我没有合著者,并且不打算做fossil diff或fossil ui类似的事情,直到我需要深入研究我项目的历史时,我希望这永远不会发生。
编辑。我是一个完全的新手。我不确定我是否理解、、 等的含义checkout,因此尽管花费了无数时间尝试,但我很难从手册中获得任何内容。我不太了解这个页面:http : //fossil-scm.org/fossil/help/openmanifestleaffossil open
对于单个开发人员来说,化石存储库的生命周期可以非常简单:
fossil new 创建存储库文件本身。 fossil open 创建第一个(或可能唯一的)活动工作区fossil add, fossil remove,fossil rename并fossil addremove让化石了解要跟踪的文件。fossil commit 提交对存储库的更改在项目的整个生命周期中根据需要重复第 3 步和第 4 步。
这是化石最强大的优势之一:它的设计非常低俗。您可以单独维护一个非常复杂的项目,并且实际上只能fossil commit定期使用。
The next stage of sophistication can move in several directions. If you want to share work on a project with a second developer, you will want to learn more about cloning a repository and synchronizing updates. If you want to allow for independent work on a feature without breaking your trunk builds, you can learn more about branching and merging. If you want to take advantage of the wiki and ticket tracker features, you will want to learn about fossil ui, fossil server or configure your web server to launch fossil.
But none of those use cases will require the use of the fossil close command. In fact, the output of fossil help recently got split into a shorter list of commands that are needed by most users, and a longer list of all the commands. In that division fossil close did not make the short list. The only functions it performs that can't be easily done by simple deletion of files is to verify that their aren't unsaved changes and to remove the open checkout from your personal list of checkouts available to the fossil all command.
Even a single developer will want to learn some of the vocabulary used by fossil's documentation.
fossil open) with a specific repository. Most fossil commands require that the current directory be within an open checkout.fossil commit and can be viewed from the web interface.Any user will want to learn about the web interface to fossil. An easy first step is to say fossil ui within an open checkout. The Timeline shows the development history with a node for each checkin, and lines drawn to show branching and merging. The web interface is highly configurable, provides a wiki and ticket tracker, and also provides a gui from which most settings related to the project and repository can be adjusted.
Fossil itself is an efficient web server for the content of the repository. In fact, most of the pages at fossil's official web site are served by fossil itself from the repository for the source code to fossil.
Aside from the web site and the individual command help available from fossil help, there are several other resources that many users should be aware of.
There is the fossil-users list with consistently high signal to noise ratio. The key developers pay attention to it, as do many helpful and knowledgeable users. The list has at least one archive, as well as a separate list for the developers to discuss new features and plans, but fossil-dev won't be interesting unless you want to work on the internals of fossil itself.
Jim Schimpf has a book that attempts to be both a tutorial and complete reference, and includes some advice on best practices. It is well worth a read.
The built-in command line help along with documentation for all the page URLs understood by the web interface is also available from fossil's web interface at the /help URL within any repository's site. That help text includes documentation of every command, including the unsupported internal test commands.
And finally, the [fossil tag][tag] here at StackOverflow can't be ignored as a resource.
fossil open 是正确的做法。就您而言,这是fossil close不必要的。
此时,您应该fossil open ../fossils/project.fsl --keep打开您的存储库,同时保留所有更改。
open命令将当前目录标记为工作目录(用 Fossil 术语来说就是checkout)。我建议您在需要移动存储库或工作目录本身之前不要关闭它。就我个人而言,只有当我转移到另一台计算机时才会发生这种情况。
\n\n要让化石识别所有变化,只需这样做fossil addremove;然后,fossil 将添加所有新文件,并删除所有已删除的文件,以便存储库再次与工作目录匹配。当然,您仍然需要随后提交更改。
请注意,addremove不会自动识别文件重命名!如果您已重命名文件,则应在执行该命令之前fossil rename让 Fossil 使用该命令知道每个文件的重命名情况。当然,如果您不介意破坏特定文件的编辑历史记录,您可以跳过这一点,让化石认为一个文件已被删除,而另一个文件被添加了。addremove