Pharo gitFileTree:如何阻止提交(仅限阶段)
Pharo gitFileTree: how to block commit (stage only)
如何配置 gitFileTree/Monticello 项目保存时不提交?
我在本地 git 存储库中有一些树外文件(自动生成的源)
我想手动提交:
- 第一阶段Smalltalk系统的所有变化,然后
- 暂存所有外部文件并且
- 一次提交所有更改
假设您想要 "export" 名为 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(它已经默认了一年左右),否则我不确定会发生什么history/ancestry
注意 3: 这不是典型的用例,因此没有用于此的 GUI,但我们可以在 Iceberg 的某些时候考虑
您可以简单地添加一个文件树存储库,它只会将包存储到磁盘而不进行任何 git 版本控制。然后你手动提交。这实际上是 GitFileTree 之前的工作流程。
如何配置 gitFileTree/Monticello 项目保存时不提交?
我在本地 git 存储库中有一些树外文件(自动生成的源) 我想手动提交:
- 第一阶段Smalltalk系统的所有变化,然后
- 暂存所有外部文件并且
- 一次提交所有更改
假设您想要 "export" 名为 Somewhere
的包到名为 breaking-mcz
.
"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(它已经默认了一年左右),否则我不确定会发生什么history/ancestry
注意 3: 这不是典型的用例,因此没有用于此的 GUI,但我们可以在 Iceberg 的某些时候考虑
您可以简单地添加一个文件树存储库,它只会将包存储到磁盘而不进行任何 git 版本控制。然后你手动提交。这实际上是 GitFileTree 之前的工作流程。