国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

關(guān)于git-lfs刪除歷史版本

這篇具有很好參考價值的文章主要介紹了關(guān)于git-lfs刪除歷史版本。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點擊"舉報違法"按鈕提交疑問。

git lfs prune [options]

Deletes local copies of LFS files which are old, thus freeing up disk
space. Prune operates by enumerating all the locally stored objects, and
then deleting any which are not referenced by at least ONE of the
following:

* the current checkout
* all existing stashes
* a 'recent branch'; see "Recent files"
* a 'recent commit' on the current branch or recent branches; see
? "Recent files"
* a commit which has not been pushed; see "Unpushed lfs files"
* any other worktree checkouts; see git ?worktree

In general terms, prune will delete files you're not currently using and
which are not 'recent', so long as they've been pushed i.e. the local
copy is not the only one.

The reflog is not considered, only commits. Therefore LFS objects that
are only referenced by orphaned commits are always deleted.

Note: you should not run git lfs prune if you have different
repositories sharing the same custom storage directory; see
git lfs config for more details about lfs.storage option.

In your Git configuration or in a .lfsconfig file, you may set
lfs.fetchexclude to a comma-separated list of paths. If
lfs.fetchexclude is defined, then any Git LFS files whose paths match
one in that list will be pruned unless they are referenced by a stash or
an unpushed commit. Paths are matched using wildcard matching as per
gitignore(5).

Options:

--dry-run:
-d:
? Don't actually delete anything, just report on what would have been done
--force:
-f:
? Prune all objects except unpushed objects, including objects required for
? currently checked out refs. Implies --recent.
--recent:
? Prune even objects that would normally be preserved by the
? configuration options specified below in "Recent files".
--verify-remote:
-c:
? Contact the remote and check that copies of the files we would delete
? definitely exist before deleting. See "Verify remote".
--no-verify-remote:
? Disables remote verification if lfs.pruneverifyremotealways was enabled in
? settings. See "Verify remote".
--verbose:
-v:
? Report the full detail of what is/would be deleted.

Recent files
------------

Prune won't delete LFS files referenced by 'recent' commits, in case you
want to use them again without having to download. The definition of
'recent' is derived from the one used by git lfs fetch to download
recent objects with the --recent option, with an offset of a number of
days (default 3) to ensure that we always keep files you download for a
few days.

Here are the git ?config settings that control this behaviour:

* lfs.pruneoffsetdays The number of extra days added to the fetch
? recent settings when using them to decide when to prune. So for a
? reference to be considered old enough to prune, it has to be this many
? days older than the oldest reference that would be downloaded via
? git lfs fetch --recent. Only used if the relevant fetch recent 'days'
? setting is non-zero. Default 3 days.
* lfs.fetchrecentrefsdays lfs.fetchrecentremoterefs
? lfs.fetchrecentcommitsdays These have the same meaning as
? git lfs fetch with the --recent option, they are used as a base for
? the offset above. Anything which falls outside of this offsetted window
? is considered old enough to prune. If a day value is zero, that
? condition is not used at all to retain objects and they will be pruned.

Unpushed lfs files
------------------

When the only copy of an LFS file is local, and it is still reachable
from any reference, that file can never be pruned, regardless of how old
it is.

To determine whether an LFS file has been pushed, we check the
difference between local refs and remote refs; where the local ref is
ahead, any LFS files referenced in those commits is unpushed and will
not be deleted. This works because the LFS pre-push hook always ensures
that LFS files are pushed before the remote branch is updated.

See "Default remote", for which remote is considered 'pushed' for
pruning purposes.

Verify remote
-------------

The --verify-remote option calls the remote to ensure that any LFS
files to be deleted have copies on the remote before actually deleting
them.

Usually the check performed by "Unpushed lfs files" is enough to
determine that files have been pushed, but if you want to be extra sure
at the expense of extra overhead you can make prune actually call the
remote API and verify the presence of the files you're about to delete
locally. See "Default remote" for which remote is checked.

You can make this behaviour the default by setting
lfs.pruneverifyremotealways to true.

In addition to the overhead of calling the remote, using this option
also requires prune to distinguish between totally unreachable files
(e.g. those that were added to the index but never committed, or
referenced only by orphaned commits), and files which are still
referenced, but by commits which are prunable. This makes the prune
process take longer.

Default remote
--------------

When identifying "Unpushed lfs files" and performing "Verify remote", a
single remote, 'origin', is normally used as the reference. This one
remote is considered canonical; even if you use multiple remotes, you
probably want to retain your local copies until they've made it to that
remote. 'origin' is used by default because that will usually be a main
central repo, or your fork of it - in both cases that's a valid remote
backup of your work. If origin doesn't exist then by default nothing
will be pruned because everything is treated as 'unpushed'.

You can alter the remote via git config: lfs.pruneremotetocheck. Set
this to a different remote name to check that one instead of 'origin'.文章來源地址http://www.zghlxwxcb.cn/news/detail-799828.html

到了這里,關(guān)于關(guān)于git-lfs刪除歷史版本的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔相關(guān)法律責任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實不符,請點擊違法舉報進行投訴反饋,一經(jīng)查實,立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費用

相關(guān)文章

  • 要Git的文件太大,如何使用Git-LFS

    要Git的文件太大,如何使用Git-LFS

    問題:要Git的文件太大 解決:使用Git-LFS,LFS原理這里不詳說了 版本新一點的Git已經(jīng)集成了Git-LFS, 不用單獨去下載 。LFS的路徑就在D:Program FilesGitmingw64bin,其中D:Program FilesGit是Git的安裝目錄。 如何用Git-LFS clone: 1、先打開一個文件夾,d:Desktop新建文件夾,cmd進入它(那

    2024年02月10日
    瀏覽(31)
  • git-lfs安裝及clone常見問題

    git-lfs安裝及clone常見問題

    1.??安裝git for windows-3.20版本,報錯Could not find git; can not register Git LFS。 錯誤原因:可能這個版本有問題。參考:Could not find Git; can not register Git LFS. · Discussion #5031 · git-lfs/git-lfs · GitHub 解決方式:安裝Git for Windows 2.36.1 2.?報錯fatal: unable to access ‘https://github.com/.......‘: Op

    2023年04月08日
    瀏覽(31)
  • 有Root與無Root安裝git-lfs

    先查看arm還是AMD 例如當前使用Rocky Linux 8.8版本的內(nèi)核。因此,應(yīng)該下載適用于Rocky Linux 8.x的Git LFS安裝包。 您可以按照以下步驟在Rocky Linux上安裝Git LFS: 打開終端或命令提示符窗口。 使用以下命令下載適用于Rocky Linux 8.x的Git LFS安裝包: 下載安裝包后,使用以下命令安裝Gi

    2024年02月16日
    瀏覽(22)
  • centOs安裝git-lfs并下載huggingface模型

    hf模型都是用git-lfs托管的,可以直接git下載的,天才第一步: 1、安裝git-lfs 2、直接git clone 3、測試模型opt-1.3b

    2024年02月12日
    瀏覽(22)
  • 無root權(quán)限安裝git-lfs(linux版)

    首先給大家看一下官方鏈接:安裝 Git Large File Storage - GitHub 文檔 git-lfs/INSTALLING.md at main · git-lfs/git-lfs (github.com) 直接用這個命令好啦~繞了一大圈 以下是手動安裝 接下來是我的步驟: 首先在本地點擊此鏈接下載:https://github.com/git-lfs/git-lfs/releases/download/v3.2.0/git-lfs-linux-amd64-

    2024年01月20日
    瀏覽(25)
  • windows下安裝使用git-lfs克隆大文件

    首先去git-lfs這里,下載相應(yīng)平臺的工具,我下載的windows版本,非安裝版本,直接配置到系統(tǒng)環(huán)境變量里 執(zhí)行以下命令驗證是否成功 這樣自動會下載里邊的大文件 如果clone的時候還沒有安裝git-lfs,可以直接在項目目錄里執(zhí)行以下命令獲取大文件

    2024年02月11日
    瀏覽(27)
  • 如何用Git-LFS上傳與下載大文件資源

    如何用Git-LFS上傳與下載大文件資源

    1.下載Git-LFS 2.安裝到git目錄下(根據(jù)你自己的git目錄選擇,若未安裝git,先安裝git) 2.1注冊github完成訪問網(wǎng)址,點擊頭像 點擊個人簡介即可進入進入個人主頁? 個人主頁會顯示倉庫,點擊右上角頭像 2.2點擊Your repositories 2.3點擊NEW 2.4填寫項目名稱,描述,并添加README 點擊創(chuàng)

    2024年04月22日
    瀏覽(22)
  • linux下安裝git-lfs的兩種方法

    一、方法一(推薦) 首先安裝git-lfs ubuntu版:? centeros版: 然后驗證安裝成功 若顯示: 則安裝成功。 二、方法二 從git官網(wǎng)上下載安裝包后,手動解壓后安裝。 詳細可參考: 安裝 Git Large File Storage - GitHub 文檔

    2024年02月07日
    瀏覽(17)
  • debian12部署Gitea服務(wù)之二——部署git-lfs

    debian12部署Gitea服務(wù)之二——部署git-lfs

    初始化之后發(fā)現(xiàn)工作空間如下內(nèi)容發(fā)生了變化: config文件增加了如下內(nèi)容: [lfs] ?? ?repositoryformatversion = 0 跟蹤大文件: 現(xiàn)在,你可以選擇需要用Git LFS跟蹤大文件,并將它們加入到Git LFS管理中。例如,如果你要跟蹤所有 .mp4 文件,可以運行: git lfs track \\\"*.mp4\\\" 執(zhí)行了上述命

    2024年03月08日
    瀏覽(21)
  • 如何下載github上用git-lfs工具下載的大文件

    要下載 GitHub 上使用 Git LFS 工具存儲的大文件,您可以進行以下步驟: 安裝 Git LFS:如果您的系統(tǒng)上沒有安裝 Git LFS,請先安裝它。可以通過終端或命令行進行安裝。 克隆存儲庫:使用以下命令克隆項目存儲庫到本地: 下載大文件:進入存儲庫目錄,并使用以下命令下載大文

    2024年02月12日
    瀏覽(50)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包