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

【版本管理 | Git 】Git最佳實踐系列(一) —— LFS & .gitignore 最佳實踐,確定不來看看?

這篇具有很好參考價值的文章主要介紹了【版本管理 | Git 】Git最佳實踐系列(一) —— LFS & .gitignore 最佳實踐,確定不來看看?。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點擊"舉報違法"按鈕提交疑問。

git lfs prune,2022Git從入門到開發(fā),git

???♂? 個人主頁: @AI_magician
??主頁地址: 作者簡介:CSDN內(nèi)容合伙人,全棧領(lǐng)域優(yōu)質(zhì)創(chuàng)作者。
?????景愿:旨在于能和更多的熱愛計算機的伙伴一起成長??!?????
???♂?聲明:本人目前大學(xué)就讀于大二,研究興趣方向人工智能&硬件(雖然硬件還沒開始玩,但一直很感興趣!希望大佬帶帶)

git lfs prune,2022Git從入門到開發(fā),git

該文章收錄專欄
[?— 《深入解析機器學(xué)習:從原理到應(yīng)用的全面指南》 —?]

.gitignore 最佳實踐

https://github.com/github/gitignore

以上有著最全的各中項目所對應(yīng)的.gitignore, 以下則是一個通用的模板

# 忽略操作系統(tǒng)生成的文件
.DS_Store
Thumbs.db

# 忽略編輯器和IDE生成的文件
.vscode/
.idea/
*.sublime-project
*.sublime-workspace

# 忽略編譯生成的文件和文件夾
/build/
/dist/

# 忽略依賴文件夾
/node_modules/
/bower_components/

# 忽略日志文件
*.log

# 忽略臨時文件
*.tmp

# 忽略系統(tǒng)文件
.DS_Store
desktop.ini

# 忽略壓縮文件
*.zip
*.rar
*.gz

# 忽略數(shù)據(jù)庫文件
*.db
*.sqlite
*.sqlite3

# 忽略IDE和編輯器配置文件
*.swp
*.swo
*.swn
*.bak

# 忽略生成的文檔文件
*.html
*.pdf
*.docx

# 忽略備份文件
*.bak
*.backup

# 忽略緩存文件
.cache/

# 忽略日志文件夾
/logs/

# 忽略臨時文件夾
/temp/
/tmp/

# 忽略編譯器和構(gòu)建工具生成的文件
.gradle/
.mvn/
target/

# 忽略Jupyter Notebook生成的文件
.ipynb_checkpoints/

# 忽略環(huán)境配置文件
.env

# 忽略IDE生成的文件
*.iml

# 忽略圖片縮略圖文件夾
/.thumbnails/

# 忽略本地配置文件
*.local

以下則是關(guān)于Python的

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
#  Usually these files are written by a python script from a template
#  before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
#   For a library or package, you might want to ignore these files since the code is
#   intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
#   According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
#   However, in case of collaboration, if having platform-specific dependencies or dependencies
#   having no cross-platform support, pipenv may install dependencies that don't work, or not
#   install all needed dependencies.
#Pipfile.lock

# poetry
#   Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
#   This is especially recommended for binary packages to ensure reproducibility, and is more
#   commonly ignored for libraries.
#   https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
#   Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
#   pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
#   in version control.
#   https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
#  JetBrains specific template is maintained in a separate JetBrains.gitignore that can
#  be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
#  and can be added to the global gitignore or merged into this file.  For a more nuclear
#  option (not recommended) you can uncomment the following to ignore the entire idea folder.
.idea/

Git lfs 清空文件

要清空您的Git Large File Storage (LFS)中的所有文件,您可以按照以下步驟進行操作:

  1. 打開命令行終端或Git Bash。

  2. 導(dǎo)航到包含您的存儲庫的本地文件夾。

  3. 運行以下命令以確保您的Git LFS是最新版本:

    git lfs update
    ```
    
  4. 運行以下命令以刪除LFS對象和相關(guān)引用:

    git lfs prune
    ```
    這將刪除存儲庫中所有未跟蹤的LFS對象。
    
  5. 運行以下命令以從存儲庫中刪除LFS對象:

    git lfs ls-files | cut -d ' ' -f 3 | xargs git rm --cached
    ```
    這將從存儲庫中刪除所有跟蹤的LFS對象。請注意,這只會從存儲庫中刪除跟蹤,而不會刪除實際的LFS對象文件。
    

    如果文件路徑中包含空格或特殊字符,可以嘗試在路徑周圍使用引號或雙引號,例如:

    git lfs ls-files | cut -d ' ' -f 3 | xargs -I {} git rm --cached "{}"
    ```
    這將確保文件路徑被正確地傳遞給`git rm --cached`命令。
    

    如果問題仍然存在,您可以嘗試手動刪除LFS跟蹤的文件。運行以下命令來查看LFS跟蹤的文件列表:

    git lfs ls-files
    
    

    然后,使用git rm --cached命令手動逐個刪除文件,例如:

    git rm --cached path/to/file.ext

    請將path/to/file.ext替換為LFS跟蹤文件的實際路徑。重復(fù)此步驟直到刪除所有LFS跟蹤的文件。

  6. 運行以下命令以提交更改:

    git commit -m "Remove all LFS objects"
    ```
    這將創(chuàng)建一個提交,刪除存儲庫中所有LFS對象的跟蹤。
    
  7. 運行以下命令以將更改推送到遠程存儲庫:

    git push origin <branch-name>
    ```
    將`<branch-name>`替換為您的分支名稱。
    

請注意,執(zhí)行上述操作將從存儲庫中移除所有LFS對象的跟蹤,但不會刪除實際的LFS對象文件。如果您希望完全刪除LFS對象文件并釋放存儲空間,請參考Git LFS的文檔或使用適當?shù)拿顏砉芾鞮FS服務(wù)器端的存儲。
git lfs prune,2022Git從入門到開發(fā),git文章來源地址http://www.zghlxwxcb.cn/news/detail-828913.html

						  ??到這里,如果還有什么疑問??
					??歡迎私信博主問題哦,博主會盡自己能力為你解答疑惑的!??
					 	 ??如果對你有幫助,你的贊是對博主最大的支持!!??

到了這里,關(guān)于【版本管理 | Git 】Git最佳實踐系列(一) —— LFS & .gitignore 最佳實踐,確定不來看看?的文章就介紹完了。如果您還想了解更多內(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)文章

  • 關(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 cur

    2024年01月18日
    瀏覽(21)
  • GIt系列(二)忽略文件(.gitignore)

    GIt系列(二)忽略文件(.gitignore)

    如果你不想讓本地倉庫的所有文件都上傳到遠程倉庫中,而是有選擇的上傳一部分的文件,比如說依賴文件,測試文件你不想提交, 可以通過 \\\".git目錄 \\\" 下的 .gitignore 文件,選擇忽略這些文件。 工作區(qū):包含 .git目錄的上一級目錄,詳見:GIt系列(一)中的工作區(qū)(Working

    2024年02月15日
    瀏覽(24)
  • 【git】git lfs 大文件管理

    【git】git lfs 大文件管理

    目錄 常用命令 原理 使用方法 報錯記錄 certificate signed by unknown authority???? ? 安裝 yum install git-lfs 第一次同時下載文件指針: git lfs clone 第一次同時下載同時下載文件本身: git lfs clone 已經(jīng)下載了的用下面的命令拉文件本身 git lfs pull Git LFS 其他命令 git lfs ls-files 顯示當前被

    2024年02月14日
    瀏覽(21)
  • 【云原生 | Docker】Linux 定時自動化備份Mysql數(shù)據(jù)到本地 & Windows 最佳實踐,確定不來看看?

    【云原生 | Docker】Linux 定時自動化備份Mysql數(shù)據(jù)到本地 & Windows 最佳實踐,確定不來看看?

    ???♂? 個人主頁: @AI_magician ??主頁地址: 作者簡介:CSDN內(nèi)容合伙人,全棧領(lǐng)域優(yōu)質(zhì)創(chuàng)作者。 ?????景愿:旨在于能和更多的熱愛計算機的伙伴一起成長??!????? ???♂?聲明:本人目前大學(xué)就讀于大二,研究興趣方向人工智能硬件(雖然硬件還沒開始玩,但一直

    2024年02月02日
    瀏覽(28)
  • 【掌握版本控制:Git 入門與實踐指南】遠程操作|標簽管理

    【掌握版本控制:Git 入門與實踐指南】遠程操作|標簽管理

    ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??慕斯主頁 : 修仙—別有洞天 ?? ????????????????????????????????????????? ??? 今日夜電波: 泥中に咲く—ウォルピスカーター ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?

    2024年03月17日
    瀏覽(63)
  • git大文件管理工具:git-lfs

    Git Large File Storage(LFS)是Git的一個擴展,它允許向Git倉庫存儲和管理大型二進制文件。對于軟件開發(fā)中使用大型的圖像、音頻文件等,Git LFS非常有用。 原理:不同于git每次保存diff,對于git來說,如果是模型或者一些設(shè)計大文件,改變一點,對于倉庫來說會增加很大的體積,

    2024年02月08日
    瀏覽(31)
  • Git的.gitignore文件、標簽管理以及給命令起別名

    Git的.gitignore文件、標簽管理以及給命令起別名

    本文主要講解Git中容易被忽略但比較重要一些知識: .gitignore 文件、標簽管理以及給命令起別名. 在新建倉庫時,有一個添加 .gitignore 模板: .gitignore 是一個用于指定 Git 忽略特定文件或文件夾的配置文件??梢酝ㄟ^在文件中列出要忽略的文件或文件夾的名稱、模式或通配符來告訴

    2024年02月11日
    瀏覽(16)
  • 【Git】在 Linux 系統(tǒng)中使用 apt 包管理器來安裝 Git LFS

    LFS 的含義為: Large File Storage Git LFS 是 Git 的擴展,旨在解決 Git 無法高效處理大文件的問題。 通常情況下, Git 將整個文件存儲在版本控制中,這對于大型文件來說可能效率低下并且占用大量存儲空間。 而 Git LFS 則通過將大文件存儲在遠程服務(wù)器上,并在 Git 倉庫中保留指向

    2024年02月10日
    瀏覽(19)
  • 【Git 入門教程】第九節(jié)、Git的最佳實踐

    【Git 入門教程】第九節(jié)、Git的最佳實踐

    Git是一個強大的版本控制系統(tǒng),可以幫助開發(fā)者管理和協(xié)調(diào)代碼庫。然而,正確使用Git并不總是容易。本文將介紹一些Git的最佳實踐,以幫助開發(fā)者更好地利用Git來管理和協(xié)調(diào)代碼庫。 ? 在使用Git時,編寫有意義的提交信息是非常重要的。提交信息應(yīng)該簡明扼要地描述所做的

    2024年02月06日
    瀏覽(15)
  • Git/GitHub/Gitee?作流最佳實踐

    我在這里為剛接觸git或者對于git不太熟悉的朋友提供一套切實可行的使用方法,建議單獨創(chuàng)建一個測試項目熟悉一下我下面講述的git使用工作流程。 如果你能按照步驟逐步理解我的思路,相信你的代碼管理能力將上升一個層次! git clone xxx 克隆拉取最新的代碼 git checkout -b

    2024年04月10日
    瀏覽(21)

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

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

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

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

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包