繁体   English   中英

Pharo gitFileTree:如何阻止提交(仅阶段)

[英]Pharo gitFileTree: how to block commit (stage only)

如何配置gitFileTree / Monticello不要在项目保存时提交?

我在本地git repo(自动生成的源代码)中有一些树外文件,我想手动提交

  • 首先是Smalltalk系统中的所有更改,然后
  • 暂存所有外部文件并
  • 一次提交所有更改

假设您想将名为Somewhere包“导出”到名为breaking-mcz GitFileTree存储库。

"get the package"
package := 'Somewhere' asPackage.

"find the repo"
repo := MCRepositoryGroup default repositories detect: [ :each | (each isKindOf: MCFileTreeGitRepository) and: [ each location includesSubstring: 'breaking-mcz' ] ].

"working copy is the current in-image state"
workingCopy := package mcWorkingCopy.

"this will create an in-memory only version; the message doesn't matter"
pseudoVersion := workingCopy newVersionWithMessage: 'Message will not be used' in: repo.

"this will file-out the current state to disk, and `git add` it to git index (no commit)"
repo internalStoreVersion: pseudoVersion.

注意1:请记住,GitFileTree的工作方式是清除磁盘上的旧代码并再次转储所有内容,因此,如果您已经对代码(在磁盘上)进行了一些未提交的修改,则应先git stash它们。

注意2:我假设您使用的是无元数据的GitFileTree(默认设置已经一年左右了),否则我不确定历史/祖先会发生什么

注意3:这不是典型的用例,因此没有GUI,但是我们可以考虑在Iceberg中使用

您可以简单地添加一个文件树存储库,该存储库仅将软件包存储在磁盘上,而不进行任何git版本控制。 然后,您手动提交。 这实际上曾经是GitFileTree之前的工作流程。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM