簡體   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